#include <cstdio>

using namespace std;

int x[100000];
long long fact[100001];

int main() {
    int n, c = 0, m = 1000000007, i;
    long long ans = 1;
    
    scanf("%d", &n);
    
    for (i = 0; i < n; i++) scanf("%d", &x[i]);
    
    fact[0] = fact[1] = 1;
    for (i = 2; i <= n; i++) fact[i] = fact[i - 1] * i % m;
    
    for (i = 0; i < n; i++) {
        if (x[i] < c * 2 + 1) {
            ans = ans * (c + 1) % m;
        } else {
            c++;
        }
    }
    
    ans = ans * fact[c] % m;
    
    printf("%lld\n", ans);
    
    return 0;
}
