#include #include #include #include #include #include #include #include #include template std::ostream& range_output(std::ostream& os_arg, InputIterator first_arg, InputIterator last_arg){ if(first_arg != last_arg){ do{ os_arg << *(first_arg++); if(first_arg == last_arg) break; os_arg << ' '; } while(true); } return os_arg; } template std::ostream& operator << (std::ostream& os_arg, const std::vector& arr_arg){ return range_output(os_arg, arr_arg.cbegin(), arr_arg.cend()); } template std::ostream& operator << (std::ostream& os_arg, const std::array& arr_arg){ return range_output(os_arg, arr_arg.cbegin(), arr_arg.cend()); } template std::ostream& operator << (std::ostream& os_arg, const std::pair& pair_arg){ return os_arg << '(' << pair_arg.first << ", " << pair_arg.second << ')'; } #ifndef ONLINE_JUDGE template void dump_out(Head head_arg){ std::cerr << head_arg << '\n'; } template void dump_out(Head head_arg, Tail... tail_args){ std::cerr << head_arg << ", "; dump_out(tail_args...); } #define dump(...) do { std::cerr << "[in line " << __LINE__ << "] " << #__VA_ARGS__ << " : "; dump_out(__VA_ARGS__); } while(false) #else #define dump(...) (void(0)) #endif int main(void){ std::cin.tie(nullptr); std::ios_base::sync_with_stdio(false); std::cout << std::fixed << std::setprecision(16); long long int n; int k; std::cin >> n >> k; std::vector A(k); for(auto& itr : A){ std::cin >> itr; --itr; } std::vector T(k); long long int prev = 0; int pos = 0; for(int i = 0; i < k; prev = A[i++]){ pos += std::min(30, A[i] - prev); T[i] = pos; } pos += std::min(30, n - A.back()); std::set S(T.cbegin(), T.cend()); std::vector X(pos + 1, false); X[pos] = true; for(int i = pos - 1; i >= 0; --i) if(S.find(i) == S.end()){ bool flag = true; for(int x = 1; x <= 3; ++x){ const int s = std::min(i + x, pos); const int t = std::min(i + 7 - x, pos); flag &= (X[s] or X[t]); } X[i] = flag; } if(X[0]) std::cout << "Yes\n"; else std::cout << "No\n"; return 0; }