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