#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 1;
const int MOD = 1e9 + 7;
long long int ad(long long int a, long long int b) {
  return ((a % MOD + b % MOD) % MOD);
}
std::vector<long long int> v[N];
long long int a[N], h[N], ans[N], n;
void seive() {
  for (int i = 1; i <= n; i++) {
    for (int j = i; j < N; j += i) {
      if (h[j]) v[j].push_back(i);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int x;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    h[x]++;
    a[i] = x;
  }
  seive();
  ans[0] = 1;
  memset(h, 0, sizeof h);
  for (int i = 1; i <= n; i++) {
    if (!h[a[i]]) {
      reverse(v[a[i]].begin(), v[a[i]].end());
      h[a[i]] = 1;
    }
    for (auto j : v[a[i]]) {
      ans[j] = ad(ans[j], ans[j - 1]);
    }
  }
  long long int out = 0;
  for (int i = 1; i <= n; i++) out = ad(out, ans[i]);
  cout << out;
  return 0;
}
