#include #define rep(i,n) for (int i = 0; i < (n); i ++) using namespace std; typedef long long ll; typedef pair PL; typedef pair P; const int INF = 1e9; const ll MOD = 1e9 + 7; const double eps = 1e-6; int main(){ int N,M; cin >> N >> M; bool flag = false; rep(i,N){ string S; cin >> S; rep(j,M - 3) { if (S.substr(j,4) == "LOVE") { flag = true; break; } } if (flag) break; } if (flag) cout << "YES" << endl; else cout << "NO" << endl; }