#include<cstdio>

using namespace std;

int N, M;
int a[100100];
int Q;

int ids[100100];
int cnts[100100];
int num;
int rev_ids[100100];

void init(){
	for(int i = 0; i < N; ++i){
		ids[i] = -1;
		cnts[i] = 0;
	}
	num = 0;
}

bool used[100100];

void restore(int *a, int L, int N){
	for(int i = 0; i < N; ++i) used[i] = false;
	for(int i = 0; i < L; ++i) used[a[i]] = true;
	int c = L;
	for(int i = 0; i < N; ++i){
		if(!used[i]) a[c++] = i;
	}
}

int fi[100100];
int la[100100];

bool solve(){
	init();
	for(int i = Q - 1; i >= 0; --i){
		int x = a[i];
		if(ids[x] == -1){
			ids[x] = num++;
			rev_ids[ids[x]] = x;
		}
		int id = ids[x];
		//printf("%d\n", id);
		if(id > 0 && cnts[id - 1] == cnts[id]){
			//nothing
		} else {
			if(cnts[id] < M){
				cnts[id]++;
			}
		}
	}
	bool flg = true;
	for(int i = 0; i < N; ++i){
		if(cnts[i] != 0 && cnts[i] != M){
			flg = false;
			break;
		}
	}
	if(flg) return true;
	/*for(int i = 0; i < N; ++i){
		printf("%d %d\n", rev_ids[i], cnts[i]);
	}
	printf("\n");*/
	int l1 = 0, l2 = 0;
	for(int i = 0; i < N; ++i){
		if(cnts[i] > 0){
			fi[i] = rev_ids[i];
			l1++;
		}
		
		if(cnts[i] == M){
			la[i] = rev_ids[i];
			l2++;
		}
	}
	restore(fi, l1, N);
	restore(la, l2, N);
	/*for(int i = 0; i < N; ++i){
		printf("%d %d\n", fi[i], la[i]);
	}*/
	for(int i = 0; i < N; ++i){
		if(fi[i] != la[i]) return false;
	}
	return true;
}

void input(){
	scanf("%d%d", &M, &N);
	scanf("%d", &Q);
	for(int i = 0; i < Q; ++i){
		scanf("%d", a + i);
		a[i]--;
	}
}

int main(){
	input();
	bool flg = solve();
	if(flg) printf("Yes\n");
	else printf("No\n");
	return 0;
}
