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