I think thus more preferred
```
if( smain.find( *it ) != string::npos ) 
    fout<<"YES"<<endl;
else
    fout<<"NO"<<endl;
```