import sys n,m = map(int,input().split()) for i in range(n): s = input() if "LOVE" in s: print("YES") sys.exit(0) print("NO")