#include #include #include #include #include #include #include using namespace std; typedef long long ll; ll N; int K; ll A[100]; int main(){ ios::sync_with_stdio(false); cin.tie(0); cout << setprecision(10) << fixed; cin >> N >> K; vector ok(6, true); for(int i = 0; i < K; i++) cin >> A[i]; for(int i = 0; i < N-1; i++){ for(int j = i+1; j < N; j++){ if(A[i]+1 == A[j]){ if(A[i] == 4 || A[i] == 6 || A[i] == 7 || A[i] >= 9){ cout << "No" << endl; return 0; } } if(A[i]+3 == A[j]){ if(A[i] == 3 || A[i] == 4 || A[i] >= 6 ){ cout << "No" << endl; return 0; } } if(A[i]+5 == A[j]){ if(A[i] == 2 || A[i] == 5 || A[i] == 7 || A[i] == 8 || A[i] >= 10){ cout << "No" << endl; return 0; } } } } cout << "Yes" << endl; }