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