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