n,m=map(int,input().split())
S=[input() for i in range(n)]
for i in range(n):
    if S[i].count("LOVE")>=1:
        print("YES");exit()
print("NO")