h,w=map(int,input().split()) ans=0 for i in range(h): if "LOVE" in input(): print("YES") exit() print("NO")