#include "testlib.h"
#include <bits/stdc++.h>

const int min_n = 1;
const int max_n = 1000;

int main (int argc, char* argv[])
{
    registerValidation(argc, argv);

    const int n = inf.readInt(min_n, max_n, "n");
    inf.readEoln();

    const std::vector<int> a = inf.readInts(n, 0, n - 1, "a", 0);
    for (int i = 0; i < n; i++)
    {
        const std::string cur_fmt = format("a[i=%d] is not in the range [0,n-1-i]=[0,%d]", i, n - 1 - i);
        inf.ensuref(0 <= a[i] && a[i] <= n - 1 - i, cur_fmt.c_str());
    }

    inf.readEoln();
    inf.readEof();
    return 0;
}
