n,m=map(int,input().split()) c=0 for i in range(n): s=input() if "LOVE" in s: c+=1 break print(["NO","YES"][c==1])