N, M = map(int, input().split()) for _ in range(N): s = input() if 'LOVE' in s: print('YES') break else: print('NO')