#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 6;
int res[N];
int main() {
  int n, k;
  while (scanf("%d%d", &n, &k) != EOF) {
    if (k == 1 || n / k <= 2)
      puts("-1");
    else {
      int cnt = 1;
      for (int i = 1; i <= n; i++) {
        res[i] = cnt;
        cnt++;
        if (cnt == k + 1) cnt = 1;
      }
      for (int i = 1; i < k; i++) swap(res[i], res[i + 1]);
      for (int i = 1; i <= n; i++) printf("%d%c", res[i], i == n ? '\n' : ' ');
    }
  }
  return 0;
}
