#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int N = 200006;
const long long INF = 1e18;
map<pair<int, int>, int> h;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  vector<int> gr(k + 1, 0);
  for (int i = 1; i <= k; i++) {
    gr[i] = n / k;
  }
  for (int i = 1; i <= n % k; i++) {
    gr[i]++;
  }
  int mn = 2e9;
  for (int i = 1; i <= k; i++) {
    mn = min(mn, gr[i]);
  }
  if (mn < 3) {
    cout << "-1\n";
    return 0;
  }
  int cur = n;
  vector<int> ans(n + 1);
  for (int i = 1; i <= k; i++) {
    for (int j = 1; j <= gr[i] - 1; j++) {
      ans[cur--] = i;
    }
  }
  for (int i = 1; i <= k; i++) {
    ans[cur--] = i;
  }
  for (int i = 1; i <= n; i++) cout << ans[i] << ' ';
  return 0;
}
