There are N arrays. The length of each array is M and initially each array contains integers (1，2，...，M) in this order.

Mr. Takahashi has decided to perform Q operations on those N arrays. For the i-th (1≤i≤Q) time, he performs the following operation.

* Choose an arbitrary array from the N arrays and move the integer a_i (1≤a_i≤M) to the front of that array. For example, after performing the operation on a_i=2 and the array (5，4，3，2，1), this array becomes (2，5，4，3，1).



Mr. Takahashi wants to make N arrays exactly the same after performing the Q operations. Determine if it is possible or not.

Constraints

* 2≤N≤10^5
* 2≤M≤10^5
* 1≤Q≤10^5
* 1≤a_i≤M

Input

The input is given from Standard Input in the following format:


N M
Q
a_1 a_2 ... a_Q


Output

Print `Yes` if it is possible to make N arrays exactly the same after performing the Q operations. Otherwise, print `No`.

Examples

Input

2 2
3
2 1 2


Output

Yes


Input

3 2
3
2 1 2


Output

No


Input

2 3
3
3 2 1


Output

Yes


Input

3 3
6
1 2 2 3 3 3


Output

No
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ld = long double;
using D = double;
using uint = unsigned int;

#ifdef WIN32
    #define LLD "%I64d"
#else
    #define LLD "%lld"
#endif

#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second

const int maxn = 100005;

bool was[maxn];
int a[maxn];
int pos[maxn];
set<int> need[maxn];
set<int> waiting;
int ans[maxn], posans[maxn];
int n, m, q;

set<pair<int, int>> wass;

int main()
{
	scanf("%d%d", &n, &m);
	scanf("%d", &q);
	for (int i = 0; i < q; i++)
	{
		scanf("%d", &a[i]);
		a[i]--;
// 		scanf("%d", &a[m + i]);
// 		a[m + i]--;
	}
// 	q += m;
	for (int i = 0; i < m; i++) was[i] = false;
	for (int i = 0; i < n; i++)
	{
		need[a[q - 1]].insert(i);
		pos[i] = 0;
	}
	ans[0] = a[q - 1];
	was[a[q - 1]] = true;
	int anslen = 1;
	for (int i = q - 1; i >= 0; i--)
	{
		if (need[a[i]].size() > 0)
		{
			int wh = *need[a[i]].begin();
			need[a[i]].erase(need[a[i]].begin());
			pos[wh]++;
			if (anslen > pos[wh]) need[ans[pos[wh]]].insert(wh);
			else waiting.insert(wh);
			continue;
		}
		if (was[a[i]]) continue;
		ans[anslen] = a[i];
		anslen++;
		for (auto t : waiting)
		{
			need[a[i]].insert(t);
		}
		waiting.clear();
		was[a[i]] = true;
		{
			int wh = *need[a[i]].begin();
			need[a[i]].erase(need[a[i]].begin());
			pos[wh]++;
			if (anslen > pos[wh]) need[ans[pos[wh]]].insert(wh);
			else waiting.insert(wh);
		}
	}
// 	cout << anslen << endl;
// 	for (int i = 0; i < anslen; i++) cout << ans[i] << ' ';
// 	cout << endl;
// 	for (int i = 0; i < n; i++) cout << pos[i] << ' ';
// 	cout << endl;
	for (int i = 0; i < m; i++) posans[i] = m;
	for (int i = 0; i < anslen; i++) posans[ans[i]] = i;
	for (int i = 0; i < n; i++) if (pos[i] < anslen)
	{
// 		cout << i << ' ' << pos[i] << endl;
		int cur = 0;
		while (pos[i] < anslen && cur < m)
		{
// 			cout << cur << ' ' << posans[cur] << ' ' << pos[i] << endl;
			if (wass.count({pos[i], cur}))
			{
				pos[i] = anslen;
				break;
			}
			wass.insert({pos[i], cur});
			if (posans[cur] > pos[i])
			{
				printf("No\n");
				return 0;
			} else if (posans[cur] == pos[i])
			{
				pos[i]++;
				cur++;
			} else
			{
				cur++;
			}
		}
		if (pos[i] < anslen)
		{
			printf("No\n");
			return 0;
		}
	}
	printf("Yes\n");
    return 0;
}