#include #define int long long using namespace std; int n, k; int a[100]; int dp[101]; bool dfs(int x) { if (x >= n) return true; if (dp[x] != -1) return dp[x]; for (int i = 1; i <= 6; i++) { if (dfs(x + i) == false && dfs(x + 7 - i) == false) { return dp[x] = false; } } return dp[x] = true; } signed main() { int i, j; cin >> n >> k; for (i = 0; i < k; i++) cin >> a[i]; for (i = k - 1; i >= 0; i--) { for (j = i - 1; j >= 0; j--) { if ((a[i] - a[j]) % 2 == 1 && a[i] - a[j] <= 5) { break; } } if (j >= 0) break; } if (i == -1) { cout << "Yes" << endl; return 0; } if (a[i] >= 100) { cout << "No" << endl; return 0; } if (n > 100) n = 100; for (i = 0; i <= 100; i++) dp[i] = -1; for (i = 0; i < k; i++) { if (a[i] < 100) { dp[a[i]] = 0; } } bool res = dfs(1); if (res) cout << "Yes" << endl; else cout << "No" << endl; return 0; }