n, m = map(int, input().split()) s = [input() for _ in range(n)] for i in s: if 'LOVE' in i: print('YES') break else: print('NO')