#include #include int main(void) { char S[51]; int i, j, n, m, c = 0, c1 = 0; scanf("%d%d", &n, &m); for (i = 0; i < n; i++) { scanf("%s", S); for (j = 0; j < m; j++) { if (strncmp(&S[j], "LOVE", 4) == 0) { c++; } } } if (c > 0) { printf("YES\n"); } else { printf("NO\n"); } }