public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        Album[] a = new Album[m];
        int total = 0;
        for (int i = 0; i < m; i++) {
            int size = sc.nextInt();
            a[i] = new Album(i+1, Math.min(size, n/2));
            total += a[i].size;
        }
        Arrays.sort(a);
        
        if (total < n) {
            System.out.println(-1);
            return;
        }
        
        int[] result = new int[n];
        
        int aIndex = 0;
        int j = 0;
        while (j < n) {
            if (a[aIndex].size == 0) {
                aIndex++;
            }
            result[j] = a[aIndex].id;
            a[aIndex].size--;
            j += 2;
        }
        
        j = 1;
        while (j < n) {
            if (a[aIndex].size == 0) {
                aIndex++;
            }
            result[j] = a[aIndex].id;
            a[aIndex].size--;
            j += 2;
        }
        
        for (int x: result) {
            System.out.printf("%d ", x);
        }
        System.out.println();
    }