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