n,m = gets.split.map(&:to_i)
hash = Hash.new(0)
m.times do
  a,b = gets.split.map(&:to_i)
  hash[a]=[hash[a],b].max
end
1.upto(n) do |i|
  next if hash[i]==0
  next if i==hash[i]
  max =hash[i]
  num =i
  (i+1..hash[i]).each do |j|
    if  hash[j]>max
      max = hash[j]
      num=j
    end
  end
  (i+1..hash[i]).each do |j|
    unless j==num
      hash.delete(j)
    end
  end
end
arr =[]
hash.each do |key,value|
  arr|=(key..value).to_a
end
arr.sort!
puts arr==(1..n).to_a ? hash.size : "Impossible"