n, m = map(int,input().split())
sc = [list(map(int,input().split())) for i in range(m)]

num = [0]*n
ans = True

for i in range(m):
    if sc[i][0] == 1 and sc[i][1] == 0:
        ans = False
        break
    if sc[i][0] > n:
        ans = False
        break
    if num[sc[i][0]-1] != 0:
        if num[sc[i][0]-1] == sc[i][1]:
            continue
        else:
            ans = False
            break
    else:
        num[sc[i][0]-1] = sc[i][1]

if num[0] == 0 and len(num) > 1:
    num[0] = 1

if ans:
    print(*num)
else:
    print('-1')