#include using namespace std; using ll=long long; using pp=pair; #define sr string #define vc vector #define db double #define fi first #define se second #define rep(i,n) for(int i=0;i<(int)n;i++) #define pb push_back #define all(v) v.begin(),v.end() #define pque priority_queue #define bpc(a) __builtin_popcount(a) int main(){ int n;cin>>n; sets; rep(i,n){ sr x;cin>>x; bool ok=s.count(x); rep(j,x.size()-1){ swap(x[j],x[j+1]); if(s.count(x))ok=true; swap(x[j],x[j+1]); } s.insert(x); if(ok)cout<<"Yes"; else cout<<"No"; cout<<"\n"; } }