n, m = map(int, input().split())
table = {}
for i in range(m):
    a, b = map(int, input().split())
    if table.get(a):
        if "{0}".format(table.get(a)).isdigit():
            table[a] = [table.get(a)] + [b]
        else:
            table[a] = table.get(a) + [b]
    else:
        table.update({a: b})

def get_single_val(val):
    if "{0}".format(val).isdigit():
        return [val]
    else:
        return val

def calc(deque, cur_way: list):
    deque = get_single_val(deque)
    cur_way = get_single_val(cur_way)
    if deque == [1]:
        if len(cur_way) == n:
            print('YES')
            print(*(cur_way + [1]))
            exit(0)
        return cur_way + [1]
    for item in deque:
        calc(table.get(item), cur_way + [item])

calc(table.get(1), 1)
print("NO")