#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, k;
  cin >> n >> k;
  if (n / k < 3) {
    cout << -1;
    return 0;
  }
  vector<int> ans(n + 1);
  int x = n / k, c = 1, j = 1;
  for (int i = 1; i <= k; i++) ans[i] = i;
  for (int i = k + 1; i <= n - n % k; i++) {
    ans[i] = c;
    ++j;
    if (j == x) {
      c++;
      j = 1;
    }
  }
  for (int i = k * x + 1; i <= n; i++) ans[i] = k;
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
}
