#include <iostream> |
using namespace std; |
int main() |
{ |
int N,M; |
cin>>N>>M; |
string str; |
int flag=1; |
for ( int i=0; i<N; i++) |
{ |
cin>>str; |
int n=str.size(),num=0,j; |
for (j=0;j<n;j++) |
{ |
if (str[j]== 'S' ) |
{ |
if (num<M) |
num++; |
else |
break ; |
} |
else |
{ |
if (num>0) |
num--; |
else |
break ; |
} |
} |
if (num==0&&j==n) |
cout<< "YES" <<endl; |
else |
cout<< "NO" <<endl; |
} |
return 0; |
} |