#include #include using namespace std; int main(void) { int n, m; char str[51]; bool flag = false; cin >> n >> m; for (int i = 0; i < n; i++) { cin >> str; for (int j = 0; j < m-3; j++) { if (strncmp(&str[j], "LOVE", 4) == 0) { cout << "YES" << endl; flag = true; break; } } if(flag) break; } if(!flag) cout << "NO"<< endl; }