#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long a, b, c, s;
int N, M;
int inp[300005];
int p[1000010];
map<int, int> mp[100005];
vector<int> v[100005];
void dfs(int i, map<int, int>::iterator it, int ret) {
  if (mp[i].end() == it) {
    v[i].push_back(ret);
    return;
  }
  int roop = it->second;
  for (int k = 0, t = 1; k <= roop; k++) {
    it->second -= k;
    dfs(i, next(it), ret * t);
    it->second += k;
    t *= it->first;
  }
}
long long dp[1000005];
int main() {
  for (int i = 2; i < 1000010; i++) {
    if (!p[i]) {
      for (int j = i; j < 1000010; j += i) {
        p[j] = i;
      }
    }
  }
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) {
    scanf("%d", inp + i);
    int t = inp[i];
    while (t != 1) {
      mp[i][p[t]]++;
      t /= p[t];
    }
    dfs(i, mp[i].begin(), 1);
    sort(v[i].rbegin(), v[i].rend());
  }
  dp[0] = 1;
  for (int i = 1; i <= N; i++) {
    for (int x : v[i]) {
      dp[x] += dp[x - 1];
      dp[x] %= mod;
    }
  }
  long long ans = 0;
  for (int i = 1; i <= N; i++) {
    ans += dp[i];
    ans %= mod;
  }
  printf("%lld", ans);
}
