#include using namespace std; #define rep(i,n) for(int i=0;i<(int)(n);i++) #define rrep(i,n) for(int i=(int)(n-1);i>=0;i--) #define ALL(v) v.begin(),v.end() #define RALL(v) v.rbegin(),v.rend() template using V=vector; template using VV=V>; using u128=__int128_t; using ll=long long; template T modpow(T x,T n,T MOD){ T ans=1; while(n){ if(n&1) ans=ans*x%MOD; x=x*x%MOD; n/=2; } return ans; } // Miller-Rabin 素数判定(2^64以下なら確定) bool is_prime(ll n){ if(n<=1) return false; if(n==2) return true; if(n%2==0) return false; vector A={2,325,9375,28178,450775,9780504,1795265022}; ll s=0,d=n-1; while(d%2==0){ //n-1=2^s*d (dは奇数) ++s; d>>=1; } for(auto a:A){ if(a%n==0) return true; ll t,x=modpow<__int128_t>(a,d,n); if(x!=1){ //a^d≡1 ならほぼ素数 for(t=0;t>m>>d; int a=100*m+d; if(is_prime(a)) cout<<"Yes\n"; else cout<<"No\n"; return 0; }