h,w = map(int, raw_input().split()) if any(["LOVE" in raw_input() for _ in range(h)]): print "YES" else: print "NO"