#include using namespace std; #define ALL(x) begin(x),end(x) #define rep(i,n) for(int i=0;i<(n);i++) #define debug(v) cout<<#v<<":";for(auto x:v){cout<bool chmax(T &a,const T &b){if(abool chmin(T &a,const T &b){if(b ostream &operator<<(ostream &os,const vector&v){ for(int i=0;i<(int)v.size();i++) os< istream &operator>>(istream &is,vector&v){ for(T &x:v)is>>x; return is; } signed main(){ ll n,k;cin>>n>>k; vector a(k); cin>>a; set st; rep(i,k) st.insert(a[i]); map check; rep(i,k) check[a[i]]=false; function dfs=[&](ll m){ if(m>=n) return true; if(check.count(m)) return check[m]; for(int x=1;x<=6;x++){ if(!dfs(m+x) and !dfs(m+7-x)) return check[m]=false; } return check[m]=true; }; cout<<(dfs(1)?"Yes":"No")<