n, m = [int(i) for i in input().strip().split(' ')] s = [input() for _ in range(n)] print('YES' if sum([1 for i in s if 'LOVE' in i]) > 0 else 'NO')