#include <bits/stdc++.h>
using namespace std;
long long mod = 998244353;
vector<long long> prime(1000001, 1);
vector<long long> fact(200001);
vector<long long> pri;
vector<long long> sdf(10000001, 1);
long long inf = 1000000000000000007;
long long modular_expo(long long x, long long y, long long mod) {
  if (y == 0) return 1;
  if (y % 2 == 0)
    return modular_expo(((x % mod) * (x % mod)) % mod, y / 2, mod);
  if (y % 2 == 1)
    return ((x % mod) *
            (modular_expo(((x % mod) * (x % mod)) % mod, (y - 1) / 2, mod)) %
            mod) %
           mod;
}
long long ncr(long long n, long long r) {
  if (n == r || r == 0) return 1;
  r = min(r, n - r);
  long long ans = fact[n];
  ans *= modular_expo(fact[n - r], mod - 2, mod);
  ans %= mod;
  ans *= modular_expo(fact[r], mod - 2, mod);
  ans %= mod;
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, k, i;
  cin >> n >> k;
  if (n / k < 3) {
    cout << -1 << endl;
    return 0;
  }
  for (i = 1; i <= k; i++) {
    cout << i << " " << i << " ";
  }
  int j = 1;
  for (i = 2 * k + 1; i <= n; i++) {
    cout << (j % k == 0 ? k : (j % k)) << " ";
    j++;
  }
  cout << endl;
}
