#include<bits/stdc++.h>

using namespace std;
using ll=long long;
#define rep2(i, a, n) for(int i = (a); i < (n); i++)
#define rep(i, n) rep2(i,0,n)

int main(){
  cin.tie(nullptr);ios_base::sync_with_stdio(false);
  int n,m;cin>>n>>m;
  string a;
  rep(i,n){
    cin>>a;
    rep(j,m-3){
      if(a[j]=='L'&&a[j+1]=='O'&&a[j+2]=='V'&&a[j+3]=='E'){
        cout<<"YES"<<endl;
        return 0;
      }
    }
  }
  cout<<"NO"<<endl;
}