n, m = gets.chomp.split.map(&:to_i)
arr, numbers, result = Array.new(n + 1, 0), [], []
m.times{
    numbers << gets.to_i
    arr[numbers.last] += 1
}
numbers.each{|x|
    arr[x] -= 1
    if arr[x] == 0
        arr[x] = -1
        result << x
    end
}
puts result.reverse
1.upto(n+1){|i| puts i if arr[i] == 0}

