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