n,m = map(int,input().split()) S = [] for i in range(n): S.append(input()) for i in range(n): if "LOVE" in S[i]: print("YES") break else: print("NO")