(define (read-2)
  (cons (read) (read)))

(define (read-commands m)
  (delete-duplicates
   (sort-by
    (if (= m 0)
        '()
        (cons (read-2) (read-commands (- m 1)))) car <)))

(define (dup-idx? cmd :optional (next-cmd (cdr cmd)))
  (if (null? next-cmd)
      #f
      (if (= (car cmd) (car next-cmd))
          #t
          (dup-idx? (cdr cmd) (cdr next-cmd)))))

(define (solve n m)
  (let ((commands (read-commands m)))
    (if (dup-idx? (map car commands))
        '(-1)
        (let next ((idx (iota n 1))
                   (cmd commands))
          (if (or (null? idx) (null? cmd))
              '()
              (let ((i (car idx))
                    (c (car cmd)))
                (cond ((< i (car c))
                       (cons (if (= i 1) 1 0) (next (cdr idx) cmd)))
                      ((= i (car c))
                       (if (and (= i 1) (= (cdr c) 0))
                           '(-1)
                           (cons (cdr c) (next (cdr idx) (cdr cmd)))))
                      ((> i (car c))
                       '(-1)))))))))

(define (main args)
  (let ((nm (read-2)))
    (if (= (cdr nm) 0)
        (print 0)
        (let ((ret (solve (car nm) (cdr nm))))
          (if (or (not (= (car nm) (length ret)))
                  (any (lambda (x) (= x -1)) ret))
              (print -1)
              (apply print ret))))) 0)
