#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<string> g(n);
  for (int i = 0; i < n; ++i) cin >> g[i];
  if (any_of(g.begin(), g.end(), [](const string &s) { return s.find("LOVE") != string::npos; })) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
}