#include using namespace std; #define REP(i,a,n) for(int i=(a); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it) #define ALLOF(c) (c).begin(), (c).end() typedef long long ll; typedef unsigned long long ull; static const ll MOD = 1000000007; int N; ll v[100005]; ll dp[100005]; ll memo[105][105]; int main(){ cin >> N; rep(i,N){ cin >> v[i+1]; } dp[1] = 1; REP(i,1,N+1){ REP(j,1,105){ dp[i] += memo[j][i%j]; dp[i] %= MOD; } if(v[i] <= 100){ memo[v[i]][i%v[i]] += dp[i]; memo[v[i]][i%v[i]] %= MOD; if(v[i] != 1){ dp[i+1] += dp[i]; dp[i+1] %= MOD; } }else{ dp[i+1] += dp[i]; dp[i+1] %= MOD; int p = i%v[i]; int j = 1; while(p*j<=N){ dp[i+p*j] += dp[i]; dp[i+p*j] %= MOD; j++; } } } cout << dp[N] << endl; return 0; }