#include #include #include #include #include using namespace std; using uint = unsigned int; using int64 = int64_t; using uint64 = uint64_t; int main() { uint N; uint K; char s0[7999]; cin >> N >> K; cin.ignore(); cin.getline( s0, sizeof( s0 ) ); K++; const string s1 = s0; const uint L = s1.size(); list A; auto itr = A.begin(); for( uint i = 0 ; i < L ; i++ ){ if( s1[i] == ' ' ){ *itr %= K; itr++; } else { *itr = *itr * 10 + ( s1[i] - '0' ); } } while( K > 0 ){ itr = A.begin(); bool b = true; for( uint j = 0 ; j < N ; j++ ){ b = ( ( *itr % 2 == 0 ) && b ) || ( ( *itr % 2 == 1 ) && ! b ); *itr /= 2; itr++; } if( b ){ cout << "YES" << endl; return 0; } K /= 2; } cout << "NO" << endl; return 0; }