#include <bits/stdc++.h>
using namespace std;
template <class T>
bool ckmax(T& x, T y) {
  return x < y ? x = y, 1 : 0;
}
template <class T>
bool ckmin(T& x, T y) {
  return x > y ? x = y, 1 : 0;
}
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = 0;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return f ? x : -x;
}
const int N = 1000005;
const int mod = 1e9 + 7;
inline int add(int x, int y) { return (x += y) >= mod ? x - mod : x; }
int n, a[N], ans, f[2][N], p[2][N];
vector<int> vc[N];
signed main() {
  n = read();
  for (int i = 1, iend = n; i <= iend; ++i)
    a[i] = read(), vc[a[i]].push_back(i);
  for (int i = 1, u = 0; i <= n; ++i, u ^= 1) {
    p[u][0] = 0;
    for (int k = i; k < N; k += i)
      for (int x : vc[k]) p[u][++p[u][0]] = x;
    sort(p[u] + 1, p[u] + p[u][0] + 1);
    int j = 1, s = 0;
    if (i == 1) {
      for (int k = 1; k <= p[u][0]; ++k) f[u][k] = 1, ans = add(ans, f[u][k]);
    } else {
      for (int k = 1; k <= p[u][0]; ++k) {
        while (j <= p[u ^ 1][0] && p[u ^ 1][j] < p[u][k])
          s = add(s, f[u ^ 1][j]), ++j;
        f[u][k] = s, ans = add(ans, s);
      }
    }
  }
  cout << ans << '\n';
}
