#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
  long long int n;
  cin >> n;
  long long int a[n + 1], i, j;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
  }
  vector<long long int> dp(n + 1);
  for (i = 1; i <= n; i++) {
    for (j = min(i, (long long int)sqrt(a[i])); j >= 1; j--) {
      if (j == 1) {
        if (a[i] <= n) dp[a[i]] = (dp[a[i] - 1] + dp[a[i]]) % mod;
        dp[1] = (dp[1] + 1) % mod;
        continue;
      }
      if (a[i] % j == 0) {
        int x = a[i] / j;
        if (x <= n) dp[x] = (dp[x] + dp[x - 1]) % mod;
        if (x != j) dp[j] = (dp[j] + dp[j - 1]) % mod;
      }
    }
  }
  long long int sum = 0;
  for (i = 1; i <= n; i++) {
    sum = (sum + dp[i]) % mod;
  }
  cout << sum << "\n";
}
