#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin >> t;
while(t--){
int n;
cin>>n;
char c;
cin>>c;
string s;
getline(cin,s);
s=s+c;
string a;
for (int i = 0; i < n; i++)
{
if((a.size() == 0) && (s[i] == 'S')){
a+=s[i];
} else if((a.size() == 1) && (s[i] == 'e')){
a+=s[i];
} else if((a.size() == 2) && (s[i] == 'r')){
a+=s[i];
} else if((a.size() == 3) && (s[i] == 'i')){
a+=s[i];
} else if((a.size() == 4) && (s[i] == 'o')){
a+=s[i];
} else if((a.size() == 5) && (s[i] == 'u')){
a+=s[i];
} else if((a.size() == 6) && (s[i] == 's')){
a+=s[i];
} else if((a.size() == 7) && (s[i] == 'O')){
a+=s[i];
} else if((a.size() == 8) && (s[i] == 'J')){
a+=s[i];
}
}
int b=unique(a.begin(),a.end())-a.begin();
if(b == 9){
cout << "YES" << endl;
} else cout<<"NO"<<endl;
}
return 0;
}