// #include "pch.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include typedef long long ll; typedef std::pair Pii; typedef std::pair Pll; typedef std::pair Pdd; #define rip(i, n, s) for (int i = (s);i < (int)( n ); i++) #define all(a) a.begin(), a.end() #define MM << " " << template using MaxHeap = std::priority_queue; template using MinHeap = std::priority_queue, std::greater>; template inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template void vdeb(std::vector &bb) { for (int i = 0;i < bb.size();i++) { if (i == bb.size() - 1) std::cout << bb[i]; else std::cout << bb[i] << ' '; } std::cout << '\n'; } template void vdeb(std::vector> &bb) { for (int i = 0;i < bb.size();i++) { std::cout << i << ' '; vdeb(bb[i]); } std::cout << '\n'; } using namespace std; int main() { ll n,k; cin >> n >> k; vector da(k); rip(i,k,0) cin >> da[i]; set st; rip(i,k,0) st.insert(da[i]); rip(i,k,0) { if(da[i] >50) { if(st.count(da[i]+1)|st.count(da[i]+3)|st.count(da[i]+5)) { cout << "No" << endl; return 0; } } } vector dp(110, false); rip(i,k,0) { if(da[i] < 100) dp[da[i]] = true; } for(int i= 99; i > -1; i--) { if(dp[i+1]&dp[i+6]) dp[i] = true; if(dp[i+2]&dp[i+5]) dp[i] = true; if(dp[i+3]&dp[i+4]) dp[i] = true; } // vdeb(dp); if(dp[1]) cout << "No" << endl; else cout << "Yes" << endl; }