#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; long long a[110]; int main() { long long n, k; cin >> n >> k; for (int i = 0; i < k; i++) { cin >> a[i]; a[i]--; } bool b = false, b1 = false; bool b2 = false, b3 = false; bool b4 = false, b5 = false; for (int i = 0; i < k; i++) { if (b2 && a[i] % 5 == 0) { b = true; } if (b1 && a[i] % 5 == 1) { b5 = true; } if (a[i] % 5 == 1) { b1 = true; } if (a[i] % 5 == 2) { b2 = true; } if (a[i] % 5 == 3) { b3 = true; } if (b3 && a[i] % 5 == 4) { b4 = true; } } if (b || b4 || b5) { cout << "No" << endl; } else { cout << "Yes" << endl; } return 0; }