/*
Sometimes I feel like I don't have a partner
Sometimes I feel like my only friend
It's the city I live in, the City of Angels
Lonely as I am, together we cry

I drive on her streets 'cause she's my companion
I walk through her hills cause she knows who I am
She sees my good deeds and she kisses me windy
I never worry, now that is a lie

I dont ever wanna feel like I did that day
Take me to the place I love, take me all the way
I dont ever wanna feel like I did that day
Take me to the place I love, take me all the way
Yeah, yeah, yeah

It's hard to believe that there's nobody out there
It's hard believe that I'm all alone
At least I have her love the city, she loves me
Lonely as I am, together we cry

And I dont ever wanna feel like I did that day
Take me to the place I love, take me all the way
And I dont ever wanna feel like I did that day
Take me to the place I love, take me all the way
Yeah, yeah, yeah, oh, no, no, no
Yeah, yeah, love me I say yeah, yeah

Under the bridge downtown is where I drew some blood
Under the bridge downtown I could not get enough
Under the bridge downtown forgot about my love
Under the bridge downtown I gave my life away
Yeah, yeah, yeah

Yeah, yeah, yeah, oh, no, no, no
Yeah, yeah, oh, no, no
I said yea yeah, Ill stay
*/

//#pragma comment(linker, "/STACK:16777216")
#define _CRT_SECURE_NO_WARNINGS

#include <fstream>
#include <iostream>
#include <string>
#include <complex>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>
#include <list>
#include <ctime>
#include <memory.h>
#include <assert.h>

#define y0 sdkfaslhagaklsldk
#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define j1 assdgsdgasghsf
#define tm sdfjahlfasfh
#define lr asgasgash
#define norm asdfasdgasdgsd

#define eps 1e-9
#define M_PI 3.141592653589793
#define bs 1000000007
#define bsize 350

using namespace std;

const int INF = 1e9;
const int N = 500031;

int n, m, Q;
int ar[N];
int last_entry[N];

int whr[N], cnt[N];

int main(){
	//freopen("fabro.in","r",stdin);
	//freopen("fabro.out","w",stdout);
	//freopen("F:/in.txt", "r", stdin);
	//freopen("F:/output.txt", "w", stdout);
	ios_base::sync_with_stdio(0);
	//cin.tie(0);
	
	cin >> n >> m >> Q;
	for (int i = 1; i <= Q; i++)
	{
		cin >> ar[i];
	}

	for (int i = 1; i <= m; i++)
	{
		last_entry[i] = -i;
	}

	for (int i = 1; i <= Q; i++)
	{
		last_entry[ar[i]] = i;
	}

	vector<pair<int,int> > order;
	for (int i = 1; i <= m; i ++)
	{
		order.push_back(make_pair(last_entry[i], i));
	}

	sort(order.begin(), order.end());
	reverse(order.begin(), order.end());
	for (int i = 0; i < order.size(); i++)
	{
	/*	if (i>0)
			cout << " ";
		cout << order[i].second;
	*/	whr[order[i].second] = i;
	}
//	cout << endl;
	
	for (int i = Q; i; --i)
	{
		int val = ar[i];
		int ps = whr[val];
		if (ps > 0 && cnt[ps - 1] == 0)
		{
			cout << "No" << endl;
			return 0;
		}

		cnt[ps]++;
		if (ps > 0 && cnt[ps] > cnt[ps - 1])
			cnt[ps]--;
	}

	int q = m - 1;
	while (q > 0 && order[q].second > order[q - 1].second)
		--q;

	if (q == 0 || cnt[q-1] >= n)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;

	cin.get(); cin.get();
	return 0;
}

Measured memory_bytes: 2804