#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
    int n, m; cin>>n>>m;
    int q; cin>>q;
    int a[100010];
    for(int i=0; i<q; i++){
        cin>>a[i];
    }
    int ind[100010];
    fill(ind, ind+m+1, -1);
    int c=0;
    vector<int> v[100010];
    for(int i=q-1; i>=0; i--){
        if(ind[a[i]]==-1){
            ind[a[i]]=c;
            v[0].push_back(a[i]);
            c++;
        }else{
            int l=0, r=n;
            while(r-l>1){
                int mid=(l+r)/2;
                if(v[mid].size()<=ind[a[i]]) r=mid;
                else l=mid;
            }
            if(r<n && v[r].size()==ind[a[i]]){
                v[r].push_back(a[i]);
            }
        }
    }
    for(int i=1; i<=m; i++) if(ind[i]==-1) v[0].push_back(i);
    int mn=0;
    for(int i=m-1; i>=1; i--){
        if(v[0][i]<v[0][i-1]){
            mn=i; break;
        }
    }
    for(int i=0; i<n; i++){
        if(v[i].size()<mn){
            cout<<"No"<<endl; return 0;
        }
    }
    cout<<"Yes"<<endl;
    return 0;
}