#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3f;
const int MOD = (int)1e9 + 7;
const int N = (int)1e6 + 7;
const double eps = 1e-7;
bool eq(const double &a, const double &b) { return fabs(a - b) < eps; }
bool ls(const double &a, const double &b) { return a + eps < b; }
bool le(const double &a, const double &b) { return eq(a, b) || ls(a, b); }
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= MOD;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % MOD;
    a = a * a % MOD;
  }
  return res;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int add(int a, int b) {
  if ((a += b) >= MOD) a -= MOD;
  return a;
}
int mul(int a, int b) { return 1ll * a * b % MOD; }
int n, k, a[N];
void Init() {}
int Solve() {
  if (n / k < 3) return !puts("-1");
  int d = n / k;
  for (int i = (0); i < (n); ++i) a[i] = min(k, i / d + 1);
  int f = 1;
  for (int i = (1); i < (n); ++i)
    if (a[i] != a[i - 1]) {
      if (f) {
        swap(a[i], a[i - 1]);
        ++i;
        f = 0;
      } else {
        swap(a[i + 1], a[i - 1]);
        i += 2;
        f = 1;
      }
    }
  for (int i = (0); i < (n); ++i) printf("%d%c", a[i], " \n"[i == n - 1]);
}
int main() {
  while (~scanf("%d%d", &n, &k)) {
    Init();
    Solve();
  }
  return 0;
}
