#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cout << setprecision(12);
  long long mod = 1000000007LL;
  long long n;
  cin >> n;
  ;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  ;
  vector<vector<long long>> indexes(1000001);
  for (int i = 0; i < n; i++) {
    indexes[a[i]].push_back(i);
  }
  long long total = n;
  map<long long, long long, greater<long long>> dp_prev, dp_curr;
  for (long long i = 1; i <= n; i++) {
    dp_prev[i] = i;
  }
  for (long long k = 2; !dp_prev.empty(); k++) {
    vector<int> next;
    for (int val = k; val <= 1000000; val += k) {
      next.insert(next.end(), indexes[val].begin(), indexes[val].end());
    }
    sort(next.begin(), next.end());
    for (int j = 0; j < next.size(); j++) {
      int i = next[j];
      auto it = dp_prev.lower_bound(i);
      if (it == dp_prev.end()) continue;
      if (dp_curr.empty()) {
        dp_curr[i + 1] = it->second;
      } else {
        dp_curr[i + 1] = (dp_curr.begin()->second + it->second) % mod;
      }
    }
    if (!dp_curr.empty()) {
      total = (total + dp_curr.begin()->second) % mod;
    }
    swap(dp_curr, dp_prev);
    dp_curr.clear();
  }
  cout << total << endl;
}
