#include <bits/stdc++.h>
using namespace std;
const int n1 = 1e9 + 7;
struct compare {
  inline bool operator()(const std::string& first,
                         const std::string& second) const {
    return first.size() < second.size();
  }
};
int is_prime(long long n) {
  int first = 1;
  for (long long i = 2; i < (long long)(sqrt(n) + 1); i++) {
    if (n % i == 0) {
      first = 0;
      break;
    }
  }
  return first;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  {
    int n, k;
    cin >> n >> k;
    vector<int> ans(n + 1);
    if (n / k < 3) {
      cout << -1 << endl;
    } else {
      for (int i = 1; i < k; i++) {
        for (int j = 0; j < (n / k - 1); j++) {
          ans[i + k * j] = i;
        }
        ans[i + (n / k - 1) * k + 1] = i;
      }
      for (int i = 1; i < n + 1; i++) {
        if (ans[i] == 0) {
          ans[i] = k;
        }
      };
      for (int i = 1; i < n + 1; i++) {
        cout << ans[i] << " ";
      };
      cout << endl;
    }
  }
  return 0;
}
