#include <bits/stdc++.h>
using namespace std;
int n, k;
int a[1111111];
int main() {
  cin >> n >> k;
  if (k == 1 || k + k + k > n) {
    cout << -1 << endl;
    return 0;
  }
  for (int(i) = (0); (i) < (k); ++(i))
    for (int(j) = (0); (j) < (3); ++(j)) a[i * 3 + j] = i + 1;
  for (int(i) = (k * 3); (i) < (n + 47); ++(i)) a[i] = 1;
  for (int(i) = (0); (i) < (k - 1); ++(i)) swap(a[i * 3 + 2], a[i * 3 + 3]);
  for (int(i) = (0); (i) < (k - 1); ++(i)) swap(a[i * 3 + 1], a[i * 3 + 2]);
  for (int(i) = (0); (i) < (n - 1); ++(i)) printf("%d ", a[i]);
  cout << a[n - 1] << endl;
  return 0;
}
