#include using namespace std; #include using namespace atcoder; #include #include using namespace boost::multiprecision; using mint=modint1000000007; #define tpf typedef tpf double db;tpf long long ll; tpf string str;tpf vector vll; tpf vector vs;tpf pair pll; tpf vector vpll;tpf vector vvll; tpf cpp_int cp;tpf complex com; tpf vector vb; int a,b; #define For(i,a,b) for(int i=(a);i<(b);++i) #define rep(i,n) For(i,0,n) #define F first #define S second #define psf push_front #define psb push_back #define epb emplace_back #define mkp make_pair #define All(x) x.begin(),x.end() #define Alld(x) All(x),greater<>() #define nxp next_permutation #define sep setprecision #define lob lower_bound const int mod = 1000000007;const ll INF=1e17; const db pi=acos(-1); const int di[]={-1,0,1,0}; const int dj[]={0,-1,0,1}; ll gcd(ll x,ll y){return y? gcd(y,x%y):x;} ll ncr(ll n,ll r){ ll x=1,y=1;rep(i,r){x*=(n-i);y*=(i+1);} return x/y; } ll pncr(ll n,ll r){ vvll v(n+1,vll(n+1));v[0][0]=1; rep(i,n)rep(j,i+1){ v[i+1][j]+=v[i][j]; v[i+1][j+1]+=v[i][j]; } return v[n][r]; } template inline bool chmin(T& a, T b){ if(a>b){a=b;return true;}return false; } template inline bool chmax(T& a, T b){ if(a> prifac(ll n){ vector> a; for(ll i=2;i*i<=n;i++){ if(n%i!=0){continue;}ll exp=0; while(n%i==0){n/=i;exp++;} a.psb(pll(i,exp)); } if(n!=1){a.psb(pll(n,1));}return a; } vll cumsum(vll a){ ll sz=a.size(); vll dp(sz+1); rep(i,sz)dp[i+1]=dp[i]+a[i]; return dp; } vll eratos(ll n){ vll f(n+1),p; rep(i,n+1)f[i]=1; For(i,2,n+1){ if(f[i]){ for(ll j=2*i;j<=n;j+=i)f[j]=0; p.psb(i); } } return p; } vll eratos2(vll a,ll n){ vb x(n),ok(n,true);vll p,res; for(ll i:a)x[i]=true; For(i,2,n){ bool f=false; for(ll j=i;j>s; str t="kadom.tsu"; vll a;ll c=0; rep(i,s.size()){ rep(j,t.size()){ if(s[i]==t[j]){a.psb(j);} } } for(ll i:a){ if(i==1)c++; } if(c==2)for(ll i=a.size()-1;i>0;i--){ if(a[i]==1){a[i]=5;break;} } if(c==2){ vll b=a; sort(All(b)); if(b!=a){cout<<"No";return 0;} } if(c==1){ vll b,d;b=d=a; sort(All(b)); rep(i,d.size()){ if(d[i]==1)d[i]=5; } sort(All(d)); if(b!=a&&d!=a){cout<<"No";return 0;} } if(a.size()!=s.size()){cout<<"No";return 0;} cout<<"Yes"; return 0; }