n,k=map(int,input().split()) if n%k: print(-1) else: print(*[i%k+1 for i in range(n)])