#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
int ans[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  if (n < 3 * k) {
    cout << -1 << '\n';
    return 0;
  }
  if (k % 2 == 0) {
    for (int i = 1; i <= 3 * k; i += 6) {
      ans[i] = ans[i + 1] = ans[i + 3] = 2 * (i / 6);
      ans[i + 2] = ans[i + 4] = ans[i + 5] = 2 * (i / 6) + 1;
    }
    for (int i = 3 * k + 1; i <= n; i++) ans[i] = 0;
  } else {
    for (int i = 1; i <= 3 * k; i += 6) {
      ans[i + 1] = ans[i + 2] = ans[i + 4] = 2 * (i / 6);
      ans[i + 3] = ans[i + 5] = ans[i + 6] = 2 * (i / 6) + 1;
    }
    for (int i = 3 * k + 1; i <= n; i++) ans[i] = k - 1;
    ans[1] = k - 1;
  }
  for (int i = 1; i <= n; i++) cout << ans[i] + 1 << ' ';
  cout << endl;
}
