a,b = map(int, input().split()) s = "NO" for i in range(a): if "LOVE" in input(): s = "YES" print(s)