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