#include <bits/stdc++.h>
using namespace std;
int a[1111111];
vector<int> v[1111111];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  if (3 * k > n) {
    puts("-1");
    return 0;
  }
  for (int i = 1; i <= n; i++) a[i] = i % k;
  while (1) {
    random_shuffle(a + 1, a + n + 1);
    for (int i = 0; i < k; i++) v[i].clear();
    for (int i = 1; i <= n; i++) v[a[i]].push_back(i);
    bool flag = 0;
    for (int i = 0; i < k; i++) {
      int d = v[i][1] - v[i][0];
      bool fl = 0;
      for (int j = 2; j < v[i].size(); j++)
        if (v[i][j] - v[i][j - 1] != d) {
          fl = 1;
          break;
        }
      if (fl == 0) {
        flag = 1;
        break;
      }
    }
    if (flag == 0) {
      for (int i = 1; i <= n; i++) printf("%d ", a[i] + 1);
      puts("");
      return 0;
    }
  }
}
