#include #include #include #define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++) int main( void ){ int a, b; if (!scanf( "%d %d", &a, &b )) return 0; if (a % b == 0){ printf( "YES\n" ); return 0; } std::queue numbers; int N = std::sqrt( a ); rep( i, 1, N + 1 ){ if (a % i == 0){ numbers.push( i ); numbers.push( a/i ); } } while(!numbers.empty()){ if (numbers.front() % b == 0){ printf( "YES\n" ); return 0; } numbers.pop(); } printf( "NO\n" ); return 0; }