n, m = map(int, input().split()) for i in range(n): s = str(input()) if s.count('LOVE'): print('YES') exit() else: print('NO')