#include #include #include using namespace std; int main(){ int n, m; cin >> n >> m; vector s(n); for (int i = 0; i < n; i++){ cin >> s[i]; } bool ok = false; for (int i = 0; i < n; i++){ for (int j = 0; j <= m - 4; j++){ if (s[i].substr(j, 4) == "LOVE"){ ok = true; } } } if (ok){ cout << "YES" << endl; } else { cout << "NO" << endl; } }