n, w = map(int, input().split()) for w in range(n): if "LOVE" in input(): print("YES") break else: print("NO")