use strict;
use warnings;

chomp(my $nm = <>);
my ($n, $m) = split(/ /, $nm);

my @num;
for my $i (0..$m-1){
  chomp(my $sc = <>);
  (my $s, my $c) = split(/ /, $sc);
  if(defined $num[$s-1] && $num[$s-1] != $c){
    print "-1\n";
    exit;
  }else{
    $num[$s-1] = $c;
  }
}

if ($n > 1){
  if ($num[0] == 0){
    print "-1\n";
    exit;
  }
  if( !(defined $num[0]) ){$num[0]=1;}
}else{
  if( !(defined $num[0]) ){$num[0]=0;}
}

if($m > 1){
  for my $i (1..$m-1){
    if (!(defined $num[$i])){$num[$i]=0;}
  }
}

print @num, "\n";
