#include #include #include #include #include #include #include using namespace std; using uint = unsigned int; using ll = long long; #define CIN( LL , A ) LL A; cin >> A #define GETLINE( A ) string A; getline( cin , A ) #define FOR_ITR( ARRAY , ITR , END ) for( auto ITR = ARRAY .begin() , END = ARRAY .end() ; ITR != END ; ITR ++ ) int main() { CIN( ll , n ); CIN( ll , m ); string S; const string L = "L"; const string O = "O"; const string V = "V"; const string E = "E"; ll state = -1; for( ll i = 0 ; i < n ; i++ ){ state = -1; cin >> S; for( ll j = 0 ; j < m ; j++ ){ const string c = S.substr( j , 1 ); if( c == L ){ state = 0; } else if( c == O ){ state = ( state == 0 ? 1 : -1 ); } else if( c == V ){ state = ( state == 1 ? 2 : -1 ); } else if( c == E ){ if( state == 2 ){ cout << "YES" << endl; return 0; } state = -1; } else { state = -1; } } } cout << "NO" << endl; return 0; }