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