import std.algorithm;
import std.array;
import std.ascii;
import std.bigint;
import std.complex;
import std.container;
import std.conv;
import std.functional;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

auto readInts() {
	return array(map!(to!int)(readln().strip().split()));
}
auto readInt() {
	return readInts()[0];
}
auto readLongs() {
	return array(map!(to!long)(readln().strip().split()));
}
auto readLong() {
	return readLongs()[0];
}

void readlnTo(T...)(ref T t) {
    auto s = readln().split();
    assert(s.length == t.length);
    foreach(ref ti; t) {
        ti = s[0].to!(typeof(ti));
        s = s[1..$];
    }
}

const real eps = 1e-10;

void main(){
    int N, M;
    readlnTo(N, M);
    auto Q = readInt();
    auto a = readInts().map!("a-1").array;
    int[] aFin;
    auto set = new RedBlackTree!int;
    foreach(ai; chain(iota(M).retro, a).retro) {
        if(ai in set) {
            continue;
        }
        aFin ~= ai;
        set.insert(ai);
    }
    auto before = new int[](M);
    foreach(i; iota(M-1)) {
        before[aFin[i+1]] = aFin[i];
    }
    before[aFin[0]] = M;
    auto count = new int[](M+1);
    count[M] = N;
    foreach_reverse(ai; a) {
        if(count[before[ai]] > 0) {
            --count[before[ai]];
            ++count[ai];
            continue;
        }
        if(count[ai] > 0) {
            continue;
        }
        writeln("No");
        return;
    }
    /*
    writeln(count);
    if(count[M] != 0) {
        writeln("No");
        return;
    }
    */
    auto next = new int[](M+1);
    foreach(i; iota(M-1)) {
        next[aFin[i]] = aFin[i+1];
    }
    next[M] = aFin[0];
    next[aFin.back] = M+1;
    bool test(int n) {
        if(n == M+1) {
            return true;
        }
        return next[n] > n && memoize!test(next[n]);
    }
    foreach(i; iota(M+1)) {
        if(count[i] != 0) {
            if(!test(next[i])) {
                writeln("No");
                return;
            }
        }
    }
    writeln("Yes");
}

