#include <bits/stdc++.h>
using namespace std;
int id[1000010];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  if (n / m < 3) {
    printf("-1\n");
    return 0;
  }
  for (int i = 1; i <= n; i += m) {
    for (int j = 1; j <= m && i + j - 1 <= n; j++) {
      id[i + j - 1] = j;
    }
  }
  int x = n - n % m;
  x -= m;
  for (int i = 1; i <= m; i++) {
    id[x + i] = i - 1;
    if (id[x + i] == 0) id[x + i] = m;
  }
  for (int i = 1; i <= n; i++) {
    printf("%d", id[i]);
    if (i == n)
      printf("\n");
    else
      printf(" ");
  }
  return 0;
}
