//------------------------------------------------------------------------------------- /* 8 4 2 1以上の形でないといけない */ //------------------------------------------------------------------------------------- // unordered_set //__builtin_popcountll //./a.out < in.txt > out.txt // g++ -std=gnu++23 -O0 -g0 -pipe -I. a.cpp #include #include using namespace std; using namespace atcoder; #ifndef ONLINE_JUDGE #define _GLIBCXX_DEBUG //[]で配列外参照をするとエラーにしてくれる。上下のやつがないとTLEになるので注意 ABC311Eのサンプル4みたいなデバック中のTLEは防げないので注意 #endif // #include // namespace boo = boost::multiprecision; using mint = modint1000000007; // 1000000007 // 998244353 using pll = pair; typedef long long ll; typedef long double ld; // #define _GLIBCXX_DEBUG #define INF (ll)2e18 #define fi first #define se second #define R return 0 #define PB push_back #define stirng string #define vll vector #define mutliset multiset #define NO cout << "No" << endl #define YES cout << "Yes" << endl #define ANS cout << ans << endl #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define dou fixed << setprecision(20) #define an cout << (ans ? "Yes" : "No") #define en cout << "------------" << endl // #define min(x,y) ((x) < (y) ? (x) : (y)) // #define max(x,y) ((x) > (y) ? (x) : (y)) #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define vv(name, h, w, type, init) \ std::vector> name((h), std::vector((w), (init))) #define vvv(name, d, h, w, type, init) \ std::vector>> name((d), \ std::vector>((h), std::vector((w), (init)))) #define vvvv(name, x, y, z, w, type, init) \ std::vector>>> name((x), \ std::vector>>((y), \ std::vector>((z), std::vector((w), (init))))) #define vvvvv(name, a, b, c, d, e, type, init) \ std::vector>>>> name( \ (a), std::vector>>>( \ (b), std::vector>>( \ (c), std::vector>( \ (d), std::vector((e), (init)))))) ll lcm(ll a, ll b) { return a / gcd(a, b) * b; } ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } long long TEN(int x) { return x == 0 ? 1 : TEN(x - 1) * 10; } template constexpr std::pair myminmax(const T& a, const T& b) { // 比較に基づいて {min, max} を直接組み立てて返す return (b < a) ? std::pair{b, a} : std::pair{a, b}; } template inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } template auto rle(const T& v) { using val_t = typename T::value_type; std::vector> res; for (const auto& elem : v) { if (res.empty() || res.back().first != elem) { res.emplace_back(elem, 1); } else { res.back().second++; } } return res; } // ll mod = (ll)1000000007; ll mod = (ll)998244353; // ll inv = 499122177; vector f1 = {0, -1, 0, 1}, f2 = {-1, 0, 1, 0}; // 四方向 vector f3 = {-1, 0, 1, 0, 1, -1, 1, -1}, f4 = {0, 1, 0, -1, 1, 1, -1, -1}; // ハチ方向 template using minpq = priority_queue, greater>; template long long reduce(const vector &a) { long long s = 0; for (auto &x : a) s += x; return s; } void yn(bool ok) { cout << (ok ? "Yes" : "No") << '\n'; } #define yu_qurid(x, y) ((x) * (x) + (y) * (y)) // ユークリッド距離 sqrtはしてないなので注意 #define mannhattan(x1, x2, y1, y2) (abs(x1 - x2) + abs(y1 - y2)) // マンハッタン距離 = |x1-x2|+|y1-y2| // reference @frest #define vc_cout(v) \ do \ { \ ll nn = v.size(); \ for (int i = 0; i < nn; i++) \ { \ cout << v[i] << " "; \ } \ cout << endl; \ } while (0) #define vv_cout(v) \ do \ { \ ll nn = v.size(); \ for (int i = 0; i < nn; i++) \ { \ for (int j = 0; j < v[i].size(); j++) \ cout << v[i][j] << " "; \ cout << endl; \ } \ } while (0) // n(10進数)をa進数に string to_oct(ll n, ll a) { string s; while (n) { s = to_string(n % a) + s; n /= a; } return s; } bool bfs_est(ll xx1, ll yy1, ll hhh, ll www) { return (0 <= xx1 && xx1 < hhh && 0 <= yy1 && www > yy1); } static const auto fast_io = []() { cin.tie(nullptr); ios::sync_with_stdio(false); return 0; }(); ll e(){ return 0; } ll op(ll a, ll b){ return a+b; } bool IsPrime(int num) // 素数判定 { if (num < 2) return false; else if (num == 2) return true; else if (num % 2 == 0) return false; double sqrtNum = sqrt(num); for (int i = 3; i <= sqrtNum; i += 2) { if (num % i == 0) { return false; } } // 素数である return true; } int main() { ll m,d; cin>>m>>d; ll r = 1; rep(i,to_string(d).size())r*=10; ll f = m *100 + d; yn(IsPrime(f)); }