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