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
#define DEB
#include<bits/stdc++.h>
#define REP(i,m) for(int i=0;i<(m);++i)
#define REPN(i,m,in) for(int i=(in);i<(m);++i)
#define ALL(t) (t).begin(),(t).end()
#define CLR(a) memset((a),0,sizeof(a))
#define pb push_back
#define mp make_pair
#define fr first
#define sc second

using namespace std;


#ifdef DEB
#define dump(x)  cerr << #x << " = " << (x) << endl
#define prl cerr<<"called:"<< __LINE__<<endl
template<class T> void debug(T a,T b){ for(;a!=b;++a) cerr<<*a<<' ';cerr<<endl;}
#else
#define dump(x) ;
#define prl ;
template<class T> void debug(T a,T b){ ;}
#endif

template<class T> void chmin(T& a,const T& b) { if(a>b) a=b; }
template<class T> void chmax(T& a,const T& b) { if(a<b) a=b; }

typedef long long int lint;
typedef pair<int,int> pi;

namespace std{
  template<class S,class T>
  ostream &operator <<(ostream& out,const pair<S,T>& a){
    out<<'('<<a.fr<<','<<a.sc<<')';
    return out;
  }
}

//const int INF=5e8;

int n,m;
int q;

int ar[100005];

vector<int> pos[100005];

int finish[100005];// N

bool done[100005];// M

void fail(){
  puts("No");
  exit(0);
}

void doit(set<int> rest){
  int lastpos=q;
  bool ng=false;
  REP(i,m) if(rest.count(i)){
    if(pos[i].empty()) lastpos=-1;
    else if(pos[i][0]>lastpos) ng=true;
    else lastpos=pos[i][0];
  }
  if(!ng){
    puts("Yes");
  }else{
    puts("No");
  }
  exit(0);
}
int main(){
  cin>>n>>m>>q;
  REP(i,q){
    scanf("%d",&ar[i]);--ar[i];
    pos[ar[i]].pb(i);
  }

  REP(i,m) reverse(ALL(pos[i]));

  {
    int lastpos=q;
    bool ng=false;
    REP(i,m){
      if(pos[i].empty()) lastpos=-1;
      else if(pos[i][0]>lastpos) ng=true;
      else lastpos=pos[i][0];
    }
    if(!ng){
      puts("Yes");
      return 0;
    }
  }
  REP(i,n) finish[i]=q;

  int seek=q-1;

  bool last=false;

  set<int> rest;
  REP(i,m) rest.insert(i);

  while(seek>=0){
    int val=ar[seek];
    if(done[val]){
      --seek;
      continue;
    }
    done[val]=1;

    int j=0;
    REP(i,n){
      while(j<pos[val].size() && finish[i]<=pos[val][j]){
        ++j;
      }
      if(j==pos[val].size()){
        doit(rest);
      }else{
        finish[i]=pos[val][j];
        ++j;
      }
    }
    rest.erase(val);
  }
  puts("Yes");

  return 0;
}


