n, m = input().split() result = "NO" for i in range(int(n)): if "LOVE" in input(): result = "YES" print(result)