n, m = map(int, input().split()) res = 0 for i in range(n): s = input().rstrip() if s.count("LOVE") != 0: res += 1 break else: pass if res != 0: print("YES") else: print("NO")