n,m = map(int,input().split()) flag = 0 for i in range(n): S = input() if S.find("LOVE") >= 1: print("YES") flag += 1 break if flag == 0: print("NO")