n,m=map(int,input().split())
flg=0
for i in range(n):
    a=input()
    if "LOVE" in a:
        flg=1
print("YES" if flg == 1 else "NO")