#define _USE_MATH_DEFINES #include using namespace std; #define FOR(i,m,n) for(int i=(m);i<(n);++i) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(),(v).end() using ll = long long; constexpr int INF = 0x3f3f3f3f; constexpr ll LINF = 0x3f3f3f3f3f3f3f3fLL; constexpr double EPS = 1e-8; constexpr int MOD = 1000000007; // constexpr int MOD = 998244353; constexpr int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1}; constexpr int dy8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dx8[] = {0, -1, -1, -1, 0, 1, 1, 1}; template inline bool chmax(T &a, U b) { return a < b ? (a = b, true) : false; } template inline bool chmin(T &a, U b) { return a > b ? (a = b, true) : false; } struct IOSetup { IOSetup() { cin.tie(nullptr); ios_base::sync_with_stdio(false); cout << fixed << setprecision(20); } } iosetup; int main() { ll n; int k; cin >> n >> k; vector a(k); REP(i, k) cin >> a[i]; REP(i, k - 1) { if (a[i] >= 10000 && a[i + 1] - a[i] <= 5) { assert(false); cout << "No\n"; return 0; } } int x = min(n, 20000LL); vector ng(x + 1, false); REP(i, k) { if (a[i] <= x) ng[a[i]] = true; } for (int i = x - 1; i >= 1; --i) { if (i + 6 <= x && ng[i + 1] && ng[i + 6]) ng[i] = true; if (i + 5 <= x && ng[i + 2] && ng[i + 5]) ng[i] = true; if (i + 4 <= x && ng[i + 3] && ng[i + 4]) ng[i] = true; } cout << (ng[1] ? "No\n" : "Yes\n"); return 0; }