import sys input=lambda: sys.stdin.readline().rstrip() n,m=map(int,input().split()) for _ in range(n): S=input() if S.count("LOVE")>0: print("YES") break else: print("NO")