#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 6;
int ans[N];
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  if (k == 1 or k * 3 > n) return !printf("-1\n");
  for (int x = 1; x <= k; x += 2) {
    for (int j = 0; j < 6; ++j) {
      if (j == 0 or j == 1 or j == 3)
        ans[(x - 1) * 3 + j + 1] = x;
      else
        ans[(x - 1) * 3 + j + 1] = x + 1;
    }
  }
  for (int i = 1; i <= n; ++i)
    if (ans[i] > k or ans[i] == 0) ans[i] = 1;
  if (n % 3 == 0 and k % 2 == 1) ans[1] = k, ans[n] = 1;
  for (int i = 1; i <= n; ++i) printf("%d ", ans[i]);
}
