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