n,m=map(int,input().split()) flag=False for i in range(n): s=input() if "LOVE" in s: flag=True if flag==True: print("YES") else: print("NO")