#include using namespace std; using i64 = long long; #define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++) int N,M; int main(){ cin >> N >> M; rep(i,0,N - 1){ string s; cin >> s; rep(j,0,M - 4){ if(s.substr(j,4) == "LOVE"){ cout << "YES" << endl; return 0; } } } cout << "NO" << endl; return 0; }