N, M = map(int, input().split()) for _ in range(N): S = input() for i in range(M): if S[i:i+4] == "LOVE": print("YES") exit() print("NO")