n, m = map(int, input().split()) flg = 0 for i in range(n): N = input() if "LOVE" in N: flg = 1 print("YES") break if flg == 0: print("NO")