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