#include using namespace std; int main() { string A, B; cin >> A >> B; if(A.substr(A.size() - 4) != "0000") { cout << "No\n"; return 0; } if(B.substr(B.size() - 4) == "0000") { cout << "Yes\n"; return 0; } int integer = stoi(A.substr(0, A.size() - 5)); int decimal = stoi(B.substr(B.size() - 4)); for(long long i = 0; i <= 10000; i++) { if(i * decimal == 10000) { // A = j ^ iならよい for(long long j = 0; j <= integer; j++) { if(integer == pow(j, i)) { cout << "Yes\n"; return 0; } } } } cout << "No\n"; return 0; }