#include #include int main(){ int n, m, len; int i, j, flag = 0; char str[50][51] = {'\0'}; scanf("%d %d\n", &n, &m); for(i = 0; i < n; i++){ scanf("%s\n", str[i]); for(j = 0; j < m - 3; j++){ if(strncmp("LOVE", &str[i][j], 4) == 0){ flag = 1; break; } } if(flag == 1) break; } if(flag == 1){ printf("YES\n"); }else{ printf("NO\n"); } return 0; }