S=input().split(' ') n=int(S[0]) m=int(S[1]) for i in range(n): A=input() for j in range(m-3): if(A[j]=='L' and A[j+1]=='O' and A[j+2]=='V' and A[j+3]=='E'): print('YES') break if(i==n and j==m-3): print('NO')