N=gets.to_i
BS=gets.split.map(&:to_i)
ans = "No"
BS.each_with_index do |b, i|
  if b > i+1
    break
  end
  ans="Yes"
end

if ans == "No"
  puts "-1"
else
  array = BS.sort
  array.each do |a|
    p a
  end
end
