#include #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; typedef long long ll; ll MOD = 998244353; int main() { ll N, K; cin >> N >> K; vector A(K); set badset; priority_queue badque; rep(i, K) { cin >> A[i]; badset.insert(A[i]); badque.push(A[i]); } while (!badque.empty()) { ll p = badque.top(); badque.pop(); for (int i = 1; i < 7; i++) { if (p - i < 1) break; if (badset.find(p - i) != badset.end()) continue; if (badset.find(p - i + 7 - i) != badset.end()) { badset.insert(p - i); badque.push(p - i); //cout << p - i << " "; } } } if (badset.find(1) == badset.end()) cout << "Yes\n"; else cout << "No\n"; }