#include <bits/stdc++.h>
using namespace std;
long long n, m, k, i, j, a[1000001], p, q, b[1000001];
int main() {
  cin >> n >> k;
  for (i = 0; i < 2 * k; i += 2) {
    m++;
    if (m > k) {
      m = 1;
    }
    a[i] = m;
    a[i + 1] = m;
    b[m] += 2;
  }
  if (2 * k >= n) {
    cout << -1;
    return 0;
  }
  for (i = 2 * k; i < n; i++) {
    a[i] = (i % k) + 1;
    b[a[i]]++;
  }
  for (i = 0; i < n; i++) {
    if (b[a[i]] <= 2) {
      cout << -1;
      return 0;
    }
  }
  for (i = 0; i < n; i++) {
    cout << a[i] << " ";
  }
}
