N,M=input().split() A='NO' for i in range(int(N)): if 'LOVE' in input():A='YES' print(A)