#include <bits/stdc++.h>
using namespace std;
void SolveA() {
  int n, S;
  cin >> n >> S;
  cout << (S + n - 1) / n;
}
void SolveB() {
  cin.sync_with_stdio(false);
  cout.sync_with_stdio(false);
  size_t n, m;
  cin >> n >> m;
  vector<long long> v(n);
  for (size_t i = 0; i < n; ++i) cin >> v[i];
  make_heap(v.begin(), v.end());
  sort_heap(v.begin(), v.end());
  reverse(v.begin(), v.end());
  long long covered = 1;
  long long y = v[0] - 1;
  for (size_t i = 1; i < n; ++i) {
    if (y > v[i]) y = v[i];
    if (y > 0) {
      ++covered;
      --y;
    }
  }
  long long sum = 0;
  for (size_t i = 0; i < n; ++i) sum += v[i];
  long long kept = v[0] + n - covered;
  cout << sum - kept;
}
void SolveC() {
  const long long MOD = 1000000007;
  cin.sync_with_stdio(false);
  cout.sync_with_stdio(false);
  size_t n;
  cin >> n;
  vector<int_least32_t> a(n);
  vector<pair<int_least32_t, int_least32_t> > v;
  vector<int> minDiv(1000001, 0);
  for (int i = 2; i <= 1000000; ++i)
    if (minDiv[i] == 0)
      for (int tmp = 2 * i; tmp <= 1000000; tmp += i) minDiv[tmp] = i;
  vector<int_least32_t> oldDivs, newDivs;
  vector<size_t> nextPos(1000001, 0);
  for (size_t i = 0; i < n; ++i) {
    int_least32_t x;
    cin >> x;
    a[i] = x;
    oldDivs.clear();
    oldDivs.push_back(1);
    while (x > 1) {
      int_least32_t p = (minDiv[x] == 0) ? x : minDiv[x];
      size_t cnt = 0;
      while (minDiv[x] == p || x == p) {
        ++cnt;
        x /= p;
      }
      newDivs.clear();
      for (size_t j = 0; j < oldDivs.size(); ++j) {
        int_least32_t v = oldDivs[j];
        newDivs.push_back(v);
        for (size_t k = 0; k < cnt; ++k) {
          v *= p;
          newDivs.push_back(v);
        }
      }
      oldDivs.swap(newDivs);
    }
    for (size_t j = 0; j < oldDivs.size(); ++j) ++nextPos[oldDivs[j]];
  }
  size_t totalCount = 0;
  for (size_t i = 1; i <= 1000000; ++i) {
    size_t tmp = totalCount + nextPos[i];
    nextPos[i] = totalCount;
    totalCount = tmp;
  }
  v.resize(totalCount);
  for (size_t i = 0; i < n; ++i) {
    int_least32_t x = a[i];
    oldDivs.clear();
    oldDivs.push_back(1);
    while (x > 1) {
      int_least32_t p = (minDiv[x] == 0) ? x : minDiv[x];
      size_t cnt = 0;
      while (minDiv[x] == p || x == p) {
        ++cnt;
        x /= p;
      }
      newDivs.clear();
      for (size_t j = 0; j < oldDivs.size(); ++j) {
        int_least32_t v = oldDivs[j];
        newDivs.push_back(v);
        for (size_t k = 0; k < cnt; ++k) {
          v *= p;
          newDivs.push_back(v);
        }
      }
      oldDivs.swap(newDivs);
    }
    for (size_t j = 0; j < oldDivs.size(); ++j)
      v[nextPos[oldDivs[j]]++] = make_pair(oldDivs[j], i);
  }
  long long ans = n;
  vector<int_least32_t> prevPos, curPos;
  vector<long long> prevVal, curVal;
  for (size_t i = 0; i < n; ++i) {
    prevPos.push_back(i);
    prevVal.push_back(1);
  }
  size_t iCur = n;
  for (int_least32_t div = 2; div <= 1000000; ++div) {
    curPos.clear();
    curVal.clear();
    long long curSum = 0;
    size_t iNextPrev = 0;
    for (; iCur < v.size() && v[iCur].first == div; ++iCur) {
      while (iNextPrev < prevPos.size() &&
             prevPos[iNextPrev] < v[iCur].second) {
        curSum += prevVal[iNextPrev];
        ++iNextPrev;
      }
      curPos.push_back(v[iCur].second);
      curVal.push_back(curSum % MOD);
    }
    for (size_t i = 0; i < curVal.size(); ++i) ans += curVal[i];
    ans = ans % MOD;
    if (curPos.empty()) break;
    curVal.swap(prevVal);
    curPos.swap(prevPos);
  }
  cout << ans;
}
void SolveD() {}
void SolveE() {}
int main() {
  SolveC();
  return 0;
}
