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