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