#include <bits/stdc++.h>
#define ALL(v) std::begin(v), std::end(v)
#define ALLR(v) std::rbegin(v), std::rend(v)
using ll = std::int64_t;
using ull = std::uint64_t;
using pll = std::pair<ll, ll>;
using tll = std::tuple<ll, ll, ll>;
template <typename T> using vec = std::vector<T>;
template <typename T> using vvec = vec<vec<T>>;
template <typename T> const T& var_min(const T &t) { return t; }
template <typename T> const T& var_max(const T &t) { return t; }
template <typename T, typename... Tail> const T& var_min(const T &t, const Tail&... tail) { return std::min(t, var_min(tail...)); }
template <typename T, typename... Tail> const T& var_max(const T &t, const Tail&... tail) { return std::max(t, var_max(tail...)); }
template <typename T, typename... Tail> void chmin(T &t, const Tail&... tail) { t = var_min(t, tail...); }
template <typename T, typename... Tail> void chmax(T &t, const Tail&... tail) { t = var_max(t, tail...); }
template <typename T> const T& clamp(const T &t, const T &low, const T &high) { return std::max(low, std::min(high, t)); }
template <typename T> void chclamp(T &t, const T &low, const T &high) { return t = clamp(t, low, high); }
template <typename T> T make_v(T init) { return init; }
template <typename T, typename... Tail> auto make_v(T init, std::size_t s, Tail... tail) { auto v = std::move(make_v(init, tail...)); return vec<decltype(v)>(s, v); }
template <typename T, std::size_t Head, std::size_t ...Tail> struct multi_dem_array { using type = std::array<typename multi_dem_array<T, Tail...>::type, Head>; };
template <typename T, std::size_t Head> struct multi_dem_array<T, Head> { using type = std::array<T, Head>; };
template <typename T, std::size_t ...Args> using mdarray = typename multi_dem_array<T, Args...>::type;
namespace init__ { struct InitIO { InitIO() { std::cin.tie(nullptr); std::ios_base::sync_with_stdio(false); std::cout << std::fixed << std::setprecision(30); } } init_io; }

bool check(const vec<ll> &qv) {
    ll cur = 1;
    for (ll e : qv) {
        if (e <= cur) continue;
        if (cur + 1 < e) return false;
        cur++;
    }
    return true;
}

bool solve() {
    ll n, m, q;
    std::cin >> n >> m >> q;
    vec<ll> cnts(n);
    vec<ll> aim;
    std::map<ll, std::set<ll>> nxts;
    vec<ll> qv(q);
    for (ll &e : qv) std::cin >> e;
    std::reverse(ALL(qv));
    if (qv[0] == 1 && check(qv)) return true;
    vec<bool> cut(m + 1);
    aim.push_back(qv[0]);
    cnts[0]++;
    cut[qv[0]] = true;
    std::set<ll> free;
    for (ll i = 1; i < n; i++) nxts[qv[0]].insert(i);
    for (ll i = 1; i < q; i++) {
        ll e = qv[i];
        auto &st = nxts[e];
        if (st.empty()) {
            if (cut[e]) continue;
            aim.push_back(e);
            cut[e] = true;
            cnts[0]++;
            for (ll idx : free) nxts[e].insert(idx);
            free.clear();
        } else {
            ll idx = *st.begin();
            cnts[idx]++;
            st.erase(idx);
            if (cnts[idx] < cnts[0]) nxts[aim[cnts[idx]]].insert(idx);
            else free.insert(idx);
        }
    }

    bool ok = true;
    for (ll i = 0; i < aim.size(); i++) if (i + 1 != aim[i]) ok = false;
    if (ok) return true;
    ll minv = *std::min_element(ALL(cnts));
    ll diff = cnts[0] - minv;
    if (diff == 0) return true;

    std::set<ll> lack;
    ok = true;
    for (ll i = minv; i < aim.size(); i++) lack.insert(aim[i]); 
    for (ll i = 1; i <= m; i++) if (!cut[i]) lack.insert(i);
    for (ll i = minv; i < aim.size(); i++) {
        ll e = aim[i];
        if (e != *lack.begin()) ok = false;
        lack.erase(e);
    }
    if(ok) return true;

    ok = true;
    for (ll i = minv; i < aim.size(); i++) if (aim[i] != 1) ok = false;
    return ok;
}

int main() {
    std::cout << (solve() ? "Yes" : "No") << std::endl;
    return 0;
}


Measured memory_bytes: 21364