n,m = map(int,input().split()) flag = False for i in range(n): s = input() if "LOVE" in s: flag = True break print("YES") if flag else print("NO")