#include <bits/stdc++.h>
using namespace std;
long double PI = 3.14159265358979323846;
long long modo = 1e9 + 7;
const long long inf = 1e13;
const long long ms = (1e6) + 5;
int ar[ms];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr);
  int n;
  int k;
  cin >> n >> k;
  int i;
  int ss = n / k;
  if (ss < 3)
    cout << "-1";
  else {
    int cc = 1;
    int fl = 0;
    int aa = 1;
    int pp = (ss - 1) * k;
    for (i = 1; i <= pp; i++) {
      ar[i] = aa;
      cc++;
      if (cc == ss) {
        cc = 1;
        aa++;
      }
    }
    aa = 1;
    for (i = pp + 1; i <= n; i++) {
      ar[i] = aa;
      aa++;
      if (aa > k) aa = 1;
    }
    for (i = 1; i <= n; i++) cout << ar[i] << " ";
  }
  return 0;
}
