n, m = map(int, input().split()) for _ in range(M): if input().find('LOVE') != -1: print('YES') exit() print('NO')