n, m = map(int, input().split()) a = 0 for i in range(n): p = input() if p.find('LOVE') == -1: pass else: a += 1 if a == 0: print("NO") else: print("YES")