#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 5;
const double EPS = 1e-9;
int n, k;
int a[MAXN];
int main() {
  scanf("%d%d", &n, &k);
  int c = n / k;
  if (c < 3) {
    printf("-1");
    return 0;
  }
  int cnt = c - 1, cur = 1, pos = 0;
  ;
  for (int i = 0;; i++) {
    a[i] = cur;
    cnt--;
    pos = i;
    if (cnt == 0) {
      cur++;
      cnt = c - 1;
      if (cur > k) break;
    }
  }
  cnt = k;
  cur = 1;
  for (int i = pos + 1; i < n; i++) {
    if (cnt > 0) {
      a[i] = cur++;
      cnt--;
    } else
      a[i] = 1;
  }
  for (int i = 0; i < n; i++) {
    printf("%d ", a[i]);
  }
  return 0;
}
