#include <iostream>
#include <cstdio>
#include <string>
#include <string.h>
#include <queue>
#include <math.h>
#include <cmath>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <bitset>
#include <list>
#include <ctype.h>
#include <cassert>
#include <stack>
#include <fstream>
#include <unordered_map>
#include <unordered_set>
#include <ctime>
#include <functional>
#include <ctime>
#include <limits>
#include <tuple>
#include <complex>
#include <numeric>

using namespace std;

#define snd second
#define fst first
#define mp make_pair
#define ll long long
#define ull unsigned long long
#define ld long double
#define pb push_back
#define left _left
#define right _right

const ld pi = acos(-1.0l);

template<typename T>
T abs(T x) {
    return x > 0 ? x : -x;
}

template<typename T>
T sqr(T x) {
    return x * x;
}

template<typename T>
bool chmin(T &x, T y) {
    if (x > y) {
        x = y;
        return true;
    }
    return false;
}

template<typename T>
bool chmax(T &x, T y) {
    if (x < y) {
        x = y;
        return true;
    }
    return false;
}

template<typename U, typename V>
ostream &operator<<(ostream &s, const pair<U, V> &x) {
    s << "(" << x.fst << ", " << x.snd << ")";
    return s;
}

template<typename U>
ostream &operator<<(ostream &s, const vector<U> &x) {
    s << "[";
    bool was = false;
    for (auto it : x) {
        if (was) {
            s << ", ";
        }
        was = true;
        s << it;
    }
    s << "]";
    return s;
}

template<typename U>
ostream &operator<<(ostream &s, const set<U> &x) {
    s << "{";
    bool was = false;
    for (auto it : x) {
        if (was) {
            s << ", ";
        }
        was = true;
        s << it;
    }
    s << "}";
    return s;
}

template<int sz>
ostream operator<<(ostream &s, const bitset<sz> &x) {
    for (int i = 0; i < sz; i++) {
        s << x[i];
    }
    return s;
}


//-----------------------------------------------------------------------------

const int maxn = 1e5 + 5;
int cnt[maxn];

int main() {
    srand(time(NULL));

    retry:
#ifdef LOCAL
    // gen();

    freopen("a.in", "r", stdin);
    //freopen("a.out", "w", stdout);
#else
    //freopen(".in", "r", stdin);
    //freopen(".out", "w", stdout);
#endif

    int n, m;
    scanf("%d %d", &n, &m);
    int q;
    scanf("%d", &q);
    vector<int> a(q);
    for (int i = 0; i < q; i++) {
        scanf("%d", &a[i]);
    }
    reverse(a.begin(), a.end());
    map<int,int> was;
    int v = 1;

    for (int &x : a) {
        if (!was.count(x)) {
            was[x] = v++;
        }
        x = was[x];
    }
    for (int i = 1; i <= m; i++) {
        if (!was.count(i)) {
            was[i] = v++;
        }
    }



    int g = 0;
    cnt[0] = n;
    for (int x : a) {
        if (cnt[x - 1]) {
            cnt[x - 1]--;
            cnt[x]++;
            chmax(g, x);
        } else {
            if (g >= x) {

            } else {
                cout << "No" << endl;
                return 0;
            }
        }
    }

    for (int i = 1; i <= m; i++) {
        int x = was[i];
        if (cnt[x - 1]) {
            cnt[x] += cnt[x - 1];
            cnt[x - 1] = 0;
            chmax(g, x);
        } else {
            if (g >= x) {

            } else {
                cout << "No" << endl;
                return 0;
            }
        }
    }

    if (cnt[v - 1] == n) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 5760