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;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define si(x) int(x.size())
const int mod=1000000007,MAX=505,INF=1<<30;

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int N,M;cin>>N>>M;
    int Q;cin>>Q;
    vector<int> A(Q);
    for(int i=0;i<Q;i++) cin>>A[i];
    
    map<int,int> MA;
    for(int i=1;i<=M;i++) MA[i]=0;
    vector<int> last,when(M+1,INF);
    
    for(int i=Q-1;i>=0;i--){
        
        if(MA[A[i]]==0){
            when[A[i]]=si(last);
            last.push_back(A[i]);
            MA[A[i]]++;
        }else if(si(last)==1){
            MA[A[i]]++;
            if(MA[A[i]]>N) MA[A[i]]=N;
        }else{
            int a,b=MA[A[i]];
            if(when[A[i]]==0){
                MA[A[i]]++;
                if(MA[A[i]]>N) MA[A[i]]=N;
            }else{
                a=MA[last[when[A[i]]-1]];
                if(a>b) MA[A[i]]++;
            }
        }
    }
    
    vector<int> X=last,Y;
    for(int i=1;i<=M;i++){
        if(when[i]==INF) X.push_back(i);
    }
    for(int i=0;i<si(last);i++){
        if(MA[last[i]]==N) Y.push_back(last[i]);
        else when[last[i]]=INF;
    }
    for(int i=1;i<=M;i++){
        if(when[i]==INF) Y.push_back(i);
    }
    
    if(X==Y) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}
