n,m=map(int,input().split()) ans="keplon" for _ in range(n): r=input() if r.__contains__("LOVE"): print("YES") exit(0) if ans=="keplon": print("NO")