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