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