N,M=map(int,input().split()) A=[input() for x in range(N)] ans=False for i in range(N): for j in range(M-3): if A[i][j]=="L" and A[i][j+1]=="O" and A[i][j+2]=="V" and A[i][j+3]=="E": ans=True break if ans: print("YES") else: print("NO")