#include <bits/stdc++.h>
using namespace std;
int ans[1000005];
int main() {
  int n, k, len, i, j, add, nid;
  scanf("%d%d", &n, &k);
  nid = 0;
  add = 1;
  if (n / k < 3)
    printf("-1\n");
  else {
    for (i = 1; i <= n; i++) {
      if (add) {
        if (nid == k)
          add = 0;
        else
          nid = nid++;
      } else {
        if (nid == 1)
          add = 1;
        else
          nid = nid--;
      }
      ans[i] = nid;
    }
    if (k % 2 == 1) {
      ans[(k + 1) / 2] = 1;
      ans[1] = (k + 1) / 2;
    }
    for (i = 1; i < n; i++) printf("%d ", ans[i]);
    printf("%d\n", ans[n]);
  }
  return 0;
}
