#include using namespace std; int main() { int n, m; cin >> n >> m; vector v(n); for (int i = 0; i < n; i++) { cin >> v.at(i); //cout << v.at(i) << endl; } int f = 0; for (int i = 0; i < n; i++) { for (int j = 0; j <= m - 4; j++) { char c = v.at(i).at(j); if (c == 'L') { string s = v.at(i).substr(j, 4); if (s == "LOVE") f = 1; } } } if (f) { cout << "YES" << endl; } else { cout << "NO" << endl; } }