#include <bits/stdc++.h>
#define fo(i, n) for(int i = 1; i <= (n); i ++)
#define out(x) cerr << #x << " = " << x << "\n"
#define type(x) __typeof((x).begin())
#define foreach(it, x) for(type(x) it = (x).begin(); it != (x).end(); ++ it)
using namespace std;
// by piano
template<typename tp> inline void read(tp &x) {
  x = 0;char c = getchar(); bool f = 0;
  for(; c < '0' || c > '9'; f |= (c == '-'), c = getchar());
  for(; c >= '0' && c <= '9'; x = (x << 3) + (x << 1) + c - '0', c = getchar());
  if(f) x = -x;
}
const int N = 1e6 + 233;
int n, one, two, a[N], sg[233];

main(void) {
  memset(sg, -1, sizeof sg);
  read(n);
  fo(i, n) read(a[i]);
  for(int i = 60; i >= 1; i --) {
    int sum = 0, p = 0;
    for(int k = 1; sum + k <= n; k ++) {
      p = k;
      sum += k;
    }
    sg[i] = p;
  }
  int ans = 0; fo(i, n) ans ^= sg[a[i]];
  puts(ans ? "NO" : "YES");
}


#include <bits/stdc++.h>
#define fo(i, n) for(int i = 1; i <= (n); i ++)
#define out(x) cerr << #x << " = " << x << "\n"
#define type(x) __typeof((x).begin())
#define foreach(it, x) for(type(x) it = (x).begin(); it != (x).end(); ++ it)
using namespace std;
// by piano
template<typename tp> inline void read(tp &x) {
  x = 0;char c = getchar(); bool f = 0;
  for(; c < '0' || c > '9'; f |= (c == '-'), c = getchar());
  for(; c >= '0' && c <= '9'; x = (x << 3) + (x << 1) + c - '0', c = getchar());
  if(f) x = -x;
}
int n, one, two;
main(void) {
  read(n);
  fo(i, n) {
    int x; read(x);
    if(x == 1) ++ one;
    else ++ two;
  }
  puts((one ^ two) & 1 ? "NO" : "YES");
}


#include <bits/stdc++.h>
#define fo(i, n) for(int i = 1; i <= (n); i ++)
#define out(x) cerr << #x << " = " << x << "\n"
#define type(x) __typeof((x).begin())
#define foreach(it, x) for(type(x) it = (x).begin(); it != (x).end(); ++ it)
using namespace std;
// by piano
template<typename tp> inline void read(tp &x) {
  x = 0;char c = getchar(); bool f = 0;
  for(; c < '0' || c > '9'; f |= (c == '-'), c = getchar());
  for(; c >= '0' && c <= '9'; x = (x << 3) + (x << 1) + c - '0', c = getchar());
  if(f) x = -x;
}
const int N = 1e6 + 233;
int n, one, two, a[N], sg[233];

main(void) {
  memset(sg, -1, sizeof sg);
  read(n);
  fo(i, n) read(a[i]);
  for(int i = 60; i >= 1; i --) {
    int sum = 0, p = 0;
    for(int k = 1; sum + k <= i; k ++) {
      p = k;
      sum += k;
    }
    sg[i] = p;
  }
  int ans = 0; fo(i, n) ans ^= sg[a[i]];
  puts(ans ? "NO" : "YES");
}


#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <queue>
#include <algorithm>

using namespace std;

vector < int > ch(61, 0);
unordered_map < long long, unordered_map < long long, int > > q;

int v;

int get(long long x, long long mask) {
	if (!x)
		return 0;
	if (q[v].count(mask))
		return q[v][mask];
	int cn = 0;
	unordered_set < int > w;
	for (int i = 1; i <= x; i++) {
		if (!((1ll << i) & mask)) {
			int y = get(x - i, mask | (1ll << i));
			w.insert(y);
		}
	}
	while (w.find(cn) != w.end())
		cn++;
	q[v][mask] = cn;
	//ch[v] ^= cn;
	return cn;
}

int main() {
	//freopen("anniversary.in", "r", stdin);
	//freopen("anniversary.out", "w", stdout);
	iostream::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

	long long x = 0;
	int n;
	cin >> n;

	for (int i = 1; i <= 10; i++) {
		v = i;
		ch[i] = get(i, 0ll);
	}
	while (n--) {
		long long y;
		cin >> y;
		x ^= ch[y];
	}

	cout << (x ? "NO\n" : "YES\n");

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <queue>
#include <algorithm>

using namespace std;

long long n, l, r;

long long len = 1;

void build() {
	long long m = n;
	while (m > 1) {
		len = (len << 1) + 1;
		m >>= 1;
	}
	return;
}

long long m, _len;

int get(long long pos) {
	if (pos == _len / 2) {
		return m % 2;
	}
	if (pos < _len / 2) {
		_len >>= 1;
		m >>= 1;
		return get(pos);
	}
	else {
		pos -= _len / 2 + 1;
		_len >>= 1;
		m >>= 1;
		return get(pos);
	}
}

int main() {
	//freopen("anniversary.in", "r", stdin);
	//freopen("anniversary.out", "w", stdout);
	iostream::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

	int x = 0;
	int n;
	cin >> n;
	while (n--) {
		int y;
		cin >> y;
		x ^= (y - 1) / 2 + 1;
	}

	cout << (x ? "NO\n" : "YES\n");

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <queue>
#include <algorithm>

using namespace std;

vector < int > ch(61);
unordered_map < long long, unordered_map < long long, int > > q;

bool get(long long x, long long mask) {
	if (!x)
		return 0;
	if (q[x][mask])
		return q[x][mask] == 1;
	bool is = 0;
	for (int i = 1; i <= x; i++) {
		if (!((1ll << i) & mask))
			is |= !get(x - i, mask | (1 << i));
	}
	if (is)
		q[x][mask] = 1;
	else
		q[x][mask] = -1;
	return is;
}

int main() {
	//freopen("anniversary.in", "r", stdin);
	//freopen("anniversary.out", "w", stdout);
	iostream::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

	long long x = 0;
	int n;
	cin >> n;
	for (int i = 1; i <= 60; i++)
		ch[i] = get(i, 0ll);
	while (n--) {
		long long y;
		cin >> y;
		x ^= ch[y];
	}

	cout << (x ? "NO\n" : "YES\n");

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <queue>
#include <algorithm>

using namespace std;

vector < int > ch(61, 0);
unordered_map < long long, unordered_map < long long, int > > q;

int v;

int get(long long x, long long mask) {
	if (!x)
		return 0;
	if (q[v].count(mask))
		return q[v][mask];
	int cn = 0;
	unordered_set < int > w;
	for (int i = 1; i <= x; i++) {
		if (!((1ll << i) & mask)) {
			int y = get(x - i, mask | (1ll << i));
			w.insert(y);
		}
	}
	while (w.find(cn) != w.end())
		cn++;
	q[v][mask] = cn;
	return cn;
}

int main() {
	//freopen("anniversary.in", "r", stdin);
	//freopen("anniversary.out", "w", stdout);
	iostream::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

	long long x = 0;
	int n;
	cin >> n;

	for (int i = 1; i <= 60; i++) {
		v = i;
		ch[i] = get(i, 0ll);
	}

	while (n--) {
		long long y;
		cin >> y;
		x ^= ch[y];
	}

	cout << (x ? "NO\n" : "YES\n");

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int MAXS = 61;

int mex[MAXS + 1];
bool sum[MAXS + 1], sons[MAXS + 1][MAXS + 1];

int main()
{
    //freopen( "input", "r", stdin );
    //freopen( "output","w", stdout);

    int idx, n, ans = 0, x;

    for (int i = 1; i < MAXS; i++)
        sons[ i ][ 0 ] = 1;

    for (int i = 1; i < MAXS; i++) {
        idx = 0;
        while( sons[ i ][ idx ] )
            idx++;
        mex[ i ] = idx;

        for (int j = MAXS-1; j >= 0; j--)
            if (sum[ j ] && j + i < MAXS)
                sum[ j + i ] = 1, sons[ j + i ][ mex[ i ] ] = 1;

        sum[ i ] = 1;
    }

    cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> x;
        ans ^= mex[ x ];
    }

    if (ans == 0)
        cout << "YES\n";
    else
        cout << "NO\n";

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long i64;

map < pair < int, i64 >, int > grundy;
map < pair < int, i64 >, bool> seen;

int solve( int value, i64 mask ) {
    if (seen[ {value, mask} ])
        return grundy[ {value, mask} ];

    bool mex[ 65 ];
    memset( mex, 0, sizeof mex );

    for (int byte = 0;  byte < value; byte++)
        if (((1<<byte) & (mask)))
            mex[ solve( value - byte - 1, mask - (1<<byte) ) ] = 1;

    for (int i = 0; i < 65; i++)
        if (!mex[ i ]) {
            grundy[ {value, mask} ] = i;
            seen[ {value, mask} ] = 1;
            return i;
        }
}

int main()
{
    //freopen( "input", "r", stdin );
    //freopen( "output","w", stdout);

    int n, ans = 0, value;

    grundy[ {0, 0} ] = 0;
    seen[ {0, 0} ] = 1;

    cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> value;
        ans ^= solve( value, (1LL<<value)-1 );
    }

    if (ans == 0)
        cout << "YES\n";
    else
        cout << "NO\n";

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int MAXS = 61;

int mex[MAXS + 5];
bool sum[MAXS + 5], sons[MAXS + 5][MAXS + 5];

int main()
{
    //freopen( "input", "r", stdin );
    //freopen( "output","w", stdout);

    int idx, n, ans = 0, x;

    for (int i = 1; i < MAXS; i++)
        sons[ i ][ 0 ] = 1;

    for (int i = 1; i < MAXS; i++) {
        idx = 0;
        while(idx < MAXS && sons[ i ][ idx ] )
            idx++;
        mex[ i ] = idx;

        for (int j = MAXS-1; j >= 0; j--)
            if (sum[ j ] && j + i < MAXS)
                sum[ j + i ] = 1, sons[ j + i ][ mex[ i ] ] = 1;

        sum[ i ] = 1;
    }

    cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> x;
        ans ^= mex[ x ];
    }

    if (ans == 0)
        cout << "YES\n";
    else
        cout << "NO\n";

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define inf 1e18
#define mod 1000000007
#define lb lower_bound
#define ub upper_bound
#define mp make_pair
#define pb push_back
#define bn binary_search
#define pq priority_queue
#define int long long
#define pii pair<int,int>
#define vi vector<int>
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) a*(b/gcd(a,b))
int dp[1000001];
signed main()
{
  memset(dp,-1,sizeof(dp));
  int n,k=0;
  cin>>n;
  dp[1]=1;
  for(int i=0;i<n;i++)
  {
    int a;
    cin>>a;
    if(i==0)
    continue;
    for(int j=sqrt(a);j>=1;j--)
    {
      if(a%j==0)
      {
        if(j*j!=a){
        if(dp[j-1]>=0)
          dp[j]=max(dp[j],k)+dp[j-1];
        if(dp[a/j-1]>=0){
          int p=sqrt(a)-j+1;
          dp[a/p]=max(dp[a/p],k)+dp[a/p-1]%mod;}
        }
      }
      else if(dp[j-1]>=0)
        dp[j]=max(dp[j],k)+dp[j-1]%mod;
      if(dp[j]>=0)
      dp[j]%=mod;
      if(dp[a/j]>=0)
      dp[a/j]%=mod;
      }
    }
    dp[1]++;
    dp[1]%=mod;
    //cout<<dp[1]<<" "<<dp[2]<<endl;
  }
  int r=0;
  for(int i=1;i<1000001;i++)
    {if(dp[i]>=0)
     r+=dp[i]%mod;
      r%=mod;}
      cout<<r;
}


#include<iostream>
#include<cmath>
#include<sstream>
#include<vector>
#include<iomanip>
#include<string>
#include<fstream>
#include<algorithm>

//#define _USE_MATH_DEFINES
#define M_PI           3.14159265358979323846  /* pi */

using namespace std;
const int MOD=1e9+7;
int main() {
    long long n, current = 2, temp;
    cin >> n;
    long long answer = 0;
    vector<int> a(n + 1), b(n + 1);

    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        b[i] = 0;
    }

    for (int i = 1; i <= n; i++) {
        temp = min(i, a[i]);
        temp = min(temp, current);
        while (temp != 1){
            if ((a[i] % temp) == 0) {
                b[temp] += b[temp - 1];
                answer += b[temp - 1];
                answer %= MOD;
                if (temp == current) current++;
            }

            temp--;
        }
        b[1]++;
        answer++;
        answer %= MOD;
    }

    cout << answer;
    return 0;
}


#include<iostream>
#include<cmath>
#include<sstream>
#include<vector>
#include<iomanip>
#include<string>
#include<fstream>
#include<algorithm>

//#define _USE_MATH_DEFINES
#define M_PI           3.14159265358979323846  /* pi */

using namespace std;
const int MOD=1e9+7;
int main() {
    long long n, current = 2, temp, counter = 0, prev = 1;
    cin >> n;
    long long answer = 0;
    vector<long long> a(n), b(n), c;

    for (long long i = 0; i < n; i++) {
        cin >> a[i];
        b[i] = 0;
    }

    for (long long i = 0; i < n; i++) {
        temp = 2;
        counter = 0;
        //prev = 1;
        while (temp * temp <= a[i] && temp <= current){
            if (a[i] % temp == 0){
                c.push_back(temp);//[counter++] = temp;
                if (a[i] / temp != temp && a[i] / temp <= current) c.push_back(a[i] / temp);//[counter++] = a[i] / temp;
            }
            temp++;
        }
        if (a[i] <= current && a[i] != 1) c.push_back(a[i]);//= a[i];
        sort(c.rbegin(), c.rend());
        for (int j = 0; j < c.size(); j++) {

            b[c[j] - 1] += b[c[j] - 2];
            b[c[j] - 1] %= MOD;
            answer += b[c[j] - 2];
            answer %= MOD;
            if (c[j] == current) current++;
        }
        c.clear();
        //c.resize(n);
        b[0]++;
        answer++;
    }

    answer %= MOD;
    cout << answer;
    return 0;
}


#include<iostream>
#include<cmath>
#include<sstream>
#include<vector>
#include<iomanip>
#include<string>
#include<fstream>
#include<algorithm>

//#define _USE_MATH_DEFINES
#define M_PI           3.14159265358979323846  /* pi */

using namespace std;

int main() {
	int n, temp = 1;
	static long long answer = 0;
	cin >> n;
	static vector<int> a(n);
	static vector<long long> b(n + 1);

	for (int i = 0; i < n; i++) {
		cin >> a[i];
		b[i] = 0;
	}

	for (int i = 0; i < n; i++) {
		temp = min(i + 1, a[i]);
		while (temp) {
			if (a[i] % temp == 0) {
				if (b[temp - 1] != 0 && temp != 1) b[temp - 1]  += b[temp - 2];
				else if (temp == 1) b[0]++;
				else if (b[temp - 2] != 0) b[temp - 1] += b[temp - 2];
			}
			temp--;
		}
		//temp = 1;
	}

	for (int i = 0; i < n; i++) {
		answer += b[i];
		answer %= 1000000000 + 7;
	}

	cout << answer;

	//cout << endl;
	//system("PAUSE");
	return 0;
}


#include<iostream>
#include<cmath>
#include<sstream>
#include<vector>
#include<iomanip>
#include<string>
#include<fstream>
#include<algorithm>

//#define _USE_MATH_DEFINES
#define M_PI           3.14159265358979323846  /* pi */

using namespace std;
const int MOD=1e9+7;
int main() {
    long long n, current = 2, temp, counter = 0, prev = 1;
    cin >> n;
    long long answer = 0;
    vector<long long> a(n), b(n), c(n);

    for (long long i = 0; i < n; i++) {
        cin >> a[i];
        b[i] = 0;
    }

    for (long long i = 0; i < n; i++) {
        temp = 2;
        counter = 0;
        prev = 1;
        while (a[i] != 1 && temp <= i + 1 && temp <= current){
            if (a[i] % temp == 0){
                c[counter++] = temp * prev;

                //a[i] /= temp;
                //while (a[i] % temp == 0) a[i] /= temp;
            }
            temp++;
        }
        sort(c.rbegin(), c.rend());
        for (int j = 0; j < counter; j++) {
            b[c[j] - 1] += b[c[j] - 2];
            b[c[j] - 1] %= MOD;
            answer += b[c[j] - 2];
            answer %= MOD;
            if (c[j] == current) current++;
        }
        c.clear();
        c.resize(n);
        b[0]++;
        answer++;
    }

    answer %= MOD;
    cout << answer;
    return 0;
}


#include<iostream>
#include<cmath>
#include<sstream>
#include<vector>
#include<iomanip>
#include<string>
#include<fstream>
#include<algorithm>

//#define _USE_MATH_DEFINES
#define M_PI           3.14159265358979323846  /* pi */

using namespace std;

int main() {
	int n, temp = 1;
	static long long answer = 0;
	cin >> n;
	static vector<int> a(n);
	static vector<long long> b(n + 1);

	for (int i = 0; i < n; i++) {
		cin >> a[i];
		b[i] = 0;
	}

	for (int i = 0; i < n; i++) {
		temp = min(i + 1, a[i]);
		while (temp--) {
			if (a[i] % temp == 0) {
				if (b[temp - 1] != 0 && temp != 1 && b[temp - 2] != 0) {
					b[temp - 1] += b[temp - 2];
					answer += b[temp - 2];
					//answer %= 1000000000 + 7;
				}
				else if (temp == 1) {
					b[0]++;
					answer++;
				}

			}
		}
	}

	cout << answer;

	//cout << endl;
	//system("PAUSE");
	return 0;
}


#include<iostream>
#include<cmath>
#include<sstream>
#include<vector>
#include<iomanip>
#include<string>
#include<fstream>
#include<algorithm>

//#define _USE_MATH_DEFINES
#define M_PI           3.14159265358979323846  /* pi */

using namespace std;
const int MOD=1e9+7;
int main() {
    long long n, current = 2, temp;
    cin >> n;
    long long answer = 0;
    vector<long long> a(n), b(n);

    for (long long i = 0; i < n; i++) {
        cin >> a[i];
        b[i] = 0;
    }

    for (long long i = 0; i < n; i++) {
        temp = min(a[i], current);
        temp = min(temp, i + 1);
        while (temp != 1){
            if ((a[i] % temp) == 0) {
                b[temp - 1] += b[temp - 2];
                b[temp - 1] %= MOD;
                answer += b[temp - 2];
                answer %= MOD;
                if (temp == current) current++;
            }

            temp--;
        }
        b[0]++;
        b[0] %= MOD;
        answer++;
        answer %= MOD;
    }

    cout << answer;
    return 0;
}


#include<iostream>
#include<cmath>
#include<sstream>
#include<vector>
#include<iomanip>
#include<string>
#include<fstream>
#include<algorithm>

//#define _USE_MATH_DEFINES
#define M_PI           3.14159265358979323846  /* pi */

using namespace std;
const int MOD=1e9+7;
int main() {
    long long n, current = 2, temp;
    cin >> n;
    long long answer = 0;
    vector<long long> a(n + 1), b(n + 1);

    for (long long i = 1; i <= n; i++) {
        cin >> a[i];
        b[i] = 0;
    }

    for (long long i = 1; i <= n; i++) {
        temp = min(a[i], i);
        temp = min(temp, current);
        while (temp != 1){
            if ((a[i] % temp) == 0) {
                b[temp] += b[temp - 1];
                answer += b[temp - 1];
                answer %= MOD;
                if (temp == current) current++;
            }

            temp--;
        }
        b[1]++;
        answer++;
        answer %= MOD;
    }

    cout << answer;
    return 0;
}


#include<iostream>
#include<cmath>
#include<sstream>
#include<vector>
#include<iomanip>
#include<string>
#include<fstream>
#include<algorithm>

//#define _USE_MATH_DEFINES
#define M_PI           3.14159265358979323846  /* pi */

using namespace std;

int main() {
	int n, temp = 1;
	static long long answer = 0;
	cin >> n;
	static vector<int> a(n);
	static vector<long long> b(n);

	for (int i = 0; i < n; i++) {
		cin >> a[i];
		b[i] = 0;
	}

	for (int i = 0; i < n; i++) {
		temp = min(i + 1, a[i]);
		while (temp) {
			if (a[i] % temp == 0) {
				if (b[temp - 1] != 0 && temp != 1) b[temp - 1]  += b[temp - 2];
				else b[temp - 1]++;
			}
			temp--;
		}
		//temp = 1;
	}

	for (int i = 0; i < n; i++) {
		answer += b[i];
		answer %= 1000000000 + 7;
	}

	cout << answer;

	cout << endl;
	//system("PAUSE");
	return 0;
}


#include<iostream>
#include<cmath>
#include<sstream>
#include<vector>
#include<iomanip>
#include<string>
#include<fstream>
#include<algorithm>

//#define _USE_MATH_DEFINES
#define M_PI           3.14159265358979323846  /* pi */

using namespace std;
const int MOD=1e9+7;
int main() {
    long long n, current = 2, temp;
    cin >> n;
    long long answer = 0;
    vector<long long> a(n), b(n);

    for (long long i = 0; i < n; i++) {
        cin >> a[i];
        b[i] = 0;
    }

    for (long long i = 0; i < n; i++) {
        temp = min(a[i], current);
        while (temp != 1){
            if ((a[i] % temp) == 0) {
                b[temp - 1] += b[temp - 2];
                b[temp - 1] %= MOD;
                answer += b[temp - 2];
                answer %= MOD;
                if (temp == current) current++;
            }

            temp--;
        }
        b[0]++;
        answer++;
        answer %= MOD;
    }

    cout << answer;
    return 0;
}


#include<iostream>
#include<cmath>
#include<sstream>
#include<vector>
#include<iomanip>
#include<string>
#include<fstream>
#include<algorithm>

//#define _USE_MATH_DEFINES
#define M_PI           3.14159265358979323846  /* pi */

using namespace std;

int main() {
    int n, current = 2, temp;
    cin >> n;
    long long answer = 0;
    vector<int> a(n + 1), b(n + 1);

    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        b[i] = 0;
    }

    for (int i = 1; i <= n; i++) {
        temp = min(i, a[i]);
        temp = min(temp, current);
        while (temp != 1){
            if ((a[i] % temp) == 0) {
                b[temp] += b[temp - 1];
                answer += b[temp - 1];
                answer = answer % 1000000007;
                if (temp == current) current++;
            }

            temp--;
        }
        b[1]++;
        answer++;
    }

    cout << answer;
    return 0;
}


#include<iostream>
#include<cmath>
#include<sstream>
#include<vector>
#include<iomanip>
#include<string>
#include<fstream>
#include<algorithm>

//#define _USE_MATH_DEFINES
#define M_PI           3.14159265358979323846  /* pi */

using namespace std;
const int MOD=1e9+7;
int main() {
    int n, current = 2, temp;
    cin >> n;
    long long answer = 0;
    vector<int> a(n + 1), b(n + 1);

    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        b[i] = 0;
    }

    for (int i = 1; i <= n; i++) {
        temp = min(i, a[i]);
        temp = min(temp, current);
        while (temp != 1){
            if ((a[i] % temp) == 0) {
                b[temp] += b[temp - 1];
                answer += b[temp - 1];
                answer %= MOD;
                if (temp == current) current++;
            }

            temp--;
        }
        b[1]++;
        answer++;
        answer %= MOD;
    }

    cout << answer;
    return 0;
}


#include<iostream>
#include<cmath>
#include<sstream>
#include<vector>
#include<iomanip>
#include<string>
#include<fstream>
#include<algorithm>

//#define _USE_MATH_DEFINES
#define M_PI           3.14159265358979323846  /* pi */

using namespace std;
const int MOD=1e9+7;
int main() {
    long long n, current = 2, temp;
    cin >> n;
    //n = 1000000;
    long long answer = 0;
    vector<long long> a(n), b(n);

    for (long long i = 0; i < n; i++) {
        cin >> a[i];
       // a[i] = 1000000;
        b[i] = 0;
    }

    for (long long i = 0; i < n; i++) {
        temp = min(a[i], current);
        temp = min(temp, i + 1);
        while (temp != 1){
            if ((a[i] % temp) == 0) {
                b[temp - 1] += b[temp - 2];
                b[temp - 1] %= MOD;
                answer += b[temp - 2];
                answer %= MOD;
                if (temp == current) current++;
            }

            temp--;
        }
        b[0]++;
        //b[0] %= MOD;
        answer++;
        //answer %= MOD;
    }

    cout << answer;
    return 0;
}


#include<iostream>
#include<cmath>
#include<sstream>
#include<vector>
#include<iomanip>
#include<string>
#include<fstream>
#include<algorithm>

//#define _USE_MATH_DEFINES
#define M_PI           3.14159265358979323846  /* pi */

using namespace std;

int main() {
	int n, temp = 1;
	static long long answer = 0;
	cin >> n;
	static vector<int> a(n);
	static vector<long long> b(n + 1);

	for (int i = 0; i < n; i++) {
		cin >> a[i];
		b[i] = 0;
	}

	for (int i = 0; i < n; i++) {
		temp = min(i + 1, a[i]);
		while (temp) {
			if (a[i] % temp == 0) {
				if (b[temp - 1] != 0 && temp != 1) {
					b[temp - 1] += b[temp - 2];
					answer += b[temp - 2];
					answer %= 1000000000 + 7;
				}
				else if (temp == 1) {
					b[0]++;
					answer++;
					answer %= 1000000000 + 7;
				}
				else if (b[temp - 2] != 0) {
					b[temp - 1] += b[temp - 2];
					answer += b[temp - 2];
					answer %= 1000000000 + 7;
				}
			}
			temp--;
		}
		//temp = 1;
	}

	cout << answer;

	//cout << endl;
	//system("PAUSE");
	return 0;
}


#include<iostream>
#include<cmath>
#include<sstream>
#include<vector>
#include<iomanip>
#include<string>
#include<fstream>
#include<algorithm>

//#define _USE_MATH_DEFINES
#define M_PI           3.14159265358979323846  /* pi */

using namespace std;
const int MOD=1e9+7;
int main() {
    long long n, current = 2, temp, counter = 0;
    cin >> n;
    long long answer = 0;
    vector<long long> a(n), b(n), c(n);

    for (long long i = 0; i < n; i++) {
        cin >> a[i];
        b[i] = 0;
    }

    for (long long i = 0; i < n; i++) {
        temp = 2;
        counter = 0;
        while (a[i] != 1 && temp <= i + 1 && temp <= current){
            if (a[i] % temp == 0){
                c[counter++] = temp;
                a[i] /= temp;
                while (a[i] % temp == 0) a[i] /= temp;
            }
            temp++;
        }
        sort(c.rbegin(), c.rend());
        for (int j = 0; j < counter; j++) {
            b[c[j] - 1] += b[c[j] - 2];
            b[c[j] - 1] %= MOD;
            answer += b[c[j] - 2];
            answer %= MOD;
            if (c[counter] == current) current++;
        }
        c.clear();
        c.resize(n);
        b[0]++;
        answer++;
    }

    answer %= MOD;
    cout << answer;
    return 0;
}


#include<iostream>
#include<cmath>
#include<sstream>
#include<vector>
#include<iomanip>
#include<string>
#include<fstream>
#include<algorithm>

//#define _USE_MATH_DEFINES
#define M_PI           3.14159265358979323846  /* pi */

using namespace std;
const int MOD=1e9+7;
int main() {
    long long n, current = 2, temp;
    cin >> n;
    long long answer = 0;
    vector<long long> a(n), b(n);

    for (long long i = 0; i < n; i++) {
        cin >> a[i];
        b[i] = 0;
    }

    for (long long i = 0; i < n; i++) {
        temp = min(a[i], current);
        while (temp != 1){
            if ((a[i] % temp) == 0) {
                b[temp - 1] += b[temp - 2];
                answer += b[temp - 2];
                answer %= MOD;
                if (temp == current) current++;
            }

            temp--;
        }
        b[0]++;
        answer++;
        answer %= MOD;
    }

    cout << answer;
    return 0;
}


#include<iostream>
#include<cmath>
#include<sstream>
#include<vector>
#include<iomanip>
#include<string>
#include<fstream>
#include<algorithm>

//#define _USE_MATH_DEFINES
#define M_PI           3.14159265358979323846  /* pi */

using namespace std;
const int MOD=1e9+7;
int main() {
    long long n, current = 2, temp;
    cin >> n;
    long long answer = 0;
    vector<long long> a(n), b(n);

    for (long long i = 0; i < n; i++) {
        cin >> a[i];
        b[i] = 0;
    }

    for (long long i = 0; i < n; i++) {
        //temp = a[i - 1], temp);
        temp = min(a[i - 1], current);
        while (temp != 1){
            if ((a[i] % temp) == 0) {
                b[temp] += b[temp - 1];
                answer += b[temp - 1];
                answer %= MOD;
                if (temp == current) current++;
            }

            temp--;
        }
        b[0]++;
        answer++;
        answer %= MOD;
    }

    cout << answer;
    return 0;
}


#include<iostream>
#include<cmath>
#include<sstream>
#include<vector>
#include<iomanip>
#include<string>
#include<fstream>
#include<algorithm>

//#define _USE_MATH_DEFINES
#define M_PI           3.14159265358979323846  /* pi */

using namespace std;

int main() {
	int n, temp = 1;
	static long long answer = 0;
	cin >> n;
	static vector<int> a(n);
	static vector<long long> b(n + 1);

	for (int i = 0; i < n; i++) {
		cin >> a[i];
		b[i] = 0;
	}

	for (int i = 0; i < n; i++) {
		temp = min(i + 1, a[i]);
		while (temp) {
			if (a[i] % temp == 0) {
				if (b[temp - 1] != 0 && temp != 1) {
					b[temp - 1] += b[temp - 2];
					answer += b[temp - 2];
					//answer %= 1000000000 + 7;
				}
				else if (temp == 1) {
					b[0]++;
					answer++;
					//answer %= 1000000000 + 7;
				}
				else if (b[temp - 2] != 0) {
					b[temp - 1] += b[temp - 2];
					answer += b[temp - 2];
					//answer %= 1000000000 + 7;
				}
			}
			temp--;
		}
	}

	cout << answer % (100000000 + 7);

	//cout << endl;
	//system("PAUSE");
	return 0;
}


#include<iostream>
#include<cmath>
#include<sstream>
#include<vector>
#include<iomanip>
#include<string>
#include<fstream>
#include<algorithm>

//#define _USE_MATH_DEFINES
#define M_PI           3.14159265358979323846  /* pi */

using namespace std;
const int MOD=1e9+7;
int main() {
    long long n, current = 2, temp;
    cin >> n;
    long long answer = 0;
    vector<long long> a(n), b(n);

    for (long long i = 0; i < n; i++) {
        cin >> a[i];
        b[i] = 0;
    }

    for (long long i = 0; i < n; i++) {
        temp = min(a[i], current);
        while (temp != 1){
            if ((a[i] % temp) == 0) {
                b[temp - 1] += b[temp - 2];
                b[temp - 1] %= MOD;
                answer += b[temp - 2];
                answer %= MOD;
                if (temp == current) current++;
            }

            temp--;
        }
        b[0]++;
        b[0] %= MOD;
        answer++;
        answer %= MOD;
    }

    cout << answer;
    return 0;
}


#include<iostream>
#include<cmath>
#include<sstream>
#include<vector>
#include<iomanip>
#include<string>
#include<fstream>
#include<algorithm>

//#define _USE_MATH_DEFINES
#define M_PI           3.14159265358979323846  /* pi */

using namespace std;

int main() {
	int n, temp = 1;
	static long long answer = 0;
	cin >> n;
	static vector<int> a(n);
	static vector<long long> b(n + 1);

	for (int i = 0; i < n; i++) {
		cin >> a[i];
		b[i] = 0;
	}

	for (int i = 0; i < n; i++) {
		temp = min(i + 1, a[i]);
		for (; temp; temp--){
			if (a[i] % temp == 0) {
				if (temp != 1 && b[temp - 2] != 0) {
					b[temp - 1] += b[temp - 2];
					answer += b[temp - 2];
					//answer %= 1000000000 + 7;
				}
				else if (temp == 1) {
					b[0]++;
					answer++;
				}

			}
		}
	}

	cout << answer;

	//cout << endl;
	//system("PAUSE");
	return 0;
}


#include<iostream>
#include<cmath>
#include<sstream>
#include<vector>
#include<iomanip>
#include<string>
#include<fstream>
#include<algorithm>

//#define _USE_MATH_DEFINES
#define M_PI           3.14159265358979323846  /* pi */

using namespace std;

int main() {
	int n, temp = 1;
	static long long answer = 0;
	cin >> n;
	static vector<int> a(n);
	static vector<long long> b(100000000);

	for (int i = 0; i < n; i++) {
		cin >> a[i];
		b[i] = 0;
	}

	for (int i = 0; i < n; i++) {
		temp = min(i + 1, a[i]);
		while (temp) {
			if (a[i] % temp == 0) {
				if (b[temp - 1] != 0 && temp != 1) b[temp - 1]  += b[temp - 2];
				else if (temp == 1) b[0]++;
				else if (b[temp - 2] != 0) b[temp - 1] += b[temp - 2];
			}
			temp--;
		}
		//temp = 1;
	}

	for (int i = 0; i < n; i++) {
		answer += b[i];
		answer %= 1000000000 + 7;
	}

	cout << answer;

	//cout << endl;
	//system("PAUSE");
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
ll a[100005],dp1[100005],dp2[100005];
vector <ll> d[1000005];
int main(){
    ios_base::sync_with_stdio(false);
    ll n;
    cin >> n;
    for(long i = 1; i <= n; i++){
        cin >> a[i];
    }
    for(long i = 2; i <= 1000000; i++){
        for(long j = 2*i; j <= 1000000; j += i){
            d[j].push_back(i);
        }
        d[i].push_back(1);
        if(i != 1){
            d[i].push_back(i);
        }
    }
    d[1].push_back(1);
    dp2[1] = dp1[1] = dp2[0] = 1;
    for(long i = 2; i <= n; i++){
        for(auto f : d[a[i]]){
            //cout << f << " " << dp1[f] << " " << dp2[f-1] << endl;
            dp1[f] = (dp1[f] + dp2[f-1])%mod;
        }
        for(auto f : d[a[i]]){
            dp2[f] =  dp1[f];
        }
        //cout << endl << endl;
    }
    ll sol = 0;
    for(long i = 1; i <= n; i++){
        sol = (sol+dp1[i])%mod;
    }
    cout << sol << endl;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
ll dp1[100005],dp2[100005],a[100005];
vector <ll> d[1000005];
int main(){
    for(long i = 1; i <= 1000000; i++){
        for(long j =2*i; j <= 1000000; j += i){
            d[j].push_back(i);
        }
    }
    ll n;
    cin >> n;
    for(long i = 1; i <= n; i++){
        cin >> a[i];
    }
    dp1[1] = 1;
    for(long i = 2; i <= n; i++){
        for(auto f : d[i]){
            dp1[f] = (dp1[f] + dp2[f-1])%mod;
        }
        for(auto f : d[i]){
            dp2[f] = dp1[f];
        }
    }
    ll sol = 0;
    for(long i = 1; i <= n; i++){
        sol = (sol + dp1[i])%mod;
    }
    cout << sol << endl;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
ll dp1[100005],dp2[100005],a[100005];
vector <ll> d[1000005];
int main(){
    for(long i = 1; i <= 1000000; i++){
        for(long j =2*i; j <= 1000000; j += i){
            d[j].push_back(i);
        }
        d[i].push_back(1);
        if(i != 1){
            d[i].push_back(i);
        }
    }
    ll n;
    cin >> n;
    for(long i = 1; i <= n; i++){
        cin >> a[i];
    }
    dp1[1] = 1;
    for(long i = 2; i <= n; i++){
        for(auto f : d[a[i]]){
            dp1[f] = (dp1[f] + dp2[f-1])%mod;
        }
        for(auto f : d[i]){
            dp2[f] = dp1[f];
        }
    }
    ll sol = 0;
    for(long i = 1; i <= n; i++){
        sol = (sol + dp1[i])%mod;
    }
    cout <<(sol+n)%mod << endl;
}


#include <bits/stdc++.h>
using nsmespace std;
typedef long long ll;
const ll mod = 1000000007;
ll dp1[100005],dp2[100005],a[100005];
vector <ll> d[1000005];
int main(){
    for(long i = 1; i <= 1000000; i++){
        for(long j =2*i; j <= 1000000; j += i){
            d[j].push_back(i);
        }
    }
    ll n;
    cin >> n;
    for(long i = 1; i <= n; i++){
        cin >> a[i];
    }
    dp1[1] = 1;
    for(long i = 2; i <= n; i++){
        for(auto f : d[i]){
            dp1[f] = (dp1[f] + dp2[f-1])%mod;
        }
        for(auto f : d[i]){
            dp2[f] = dp1[f];
        }
    }
    ll sol = 0;
    for(long i = 1; i <= n; i++){
        sol = (sol + dp1[i])%mod;
    }
    cout << sol << endl;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
ll a[100005],dp1[100005],dp2[100005];
vector <ll> d[1000005];
int main(){
    ios_base::sync_with_stdio(false);
    ll n;
    cin >> n;
    for(long i = 1; i <= n; i++){
        cin >> a[i];
    }
    for(long i = 2; i <= 1000000; i++){
        d[i].push_back(1);
    }
    for(long i = 2; i <= 1000000; i++){
        for(long j = 2*i; j <= 1000000; j += i){
            d[j].push_back(i);
        }
    }
    for(long i = 2; i <= 1000000; i++){
        d[i].push_back(i);
    }
    d[1].push_back(1);
    dp2[1] = dp1[1] = dp2[0] = 1;
    for(long i = 2; i <= n; i++){
        for(auto f : d[a[i]]){
            if(f > n){
                break;
            }
            dp1[f] = (dp1[f] + dp2[f-1])%mod;
        }
        for(auto f : d[a[i]]){
            if(f > n){
                break;
            }
            dp2[f] =  dp1[f];
        }
        //cout << endl << endl;
    }
    ll sol = 0;
    for(long i = 1; i <= n; i++){
        sol = (sol+dp1[i])%mod;
    }
    cout << sol << endl;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
ll dp1[100005],dp2[100005],a[100005];
vector <ll> d[1000005];
int main(){
    for(long i = 1; i <= 1000000; i++){
        for(long j =2*i; j <= 1000000; j += i){
            d[j].push_back(i);
        }
    }
    ll n;
    cin >> n;
    for(long i = 1; i <= n; i++){
        cin >> a[i];
    }
    dp1[1] = 1;
    for(long i = 2; i <= n; i++){
        for(auto f : d[a[i]]){
            dp1[f] = (dp1[f] + dp2[f-1])%mod;
        }
        for(auto f : d[i]){
            dp2[f] = dp1[f];
        }
    }
    ll sol = 0;
    for(long i = 1; i <= n; i++){
        sol = (sol + dp1[i])%mod;
    }
    cout << sol << endl;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
ll dp1[100005],dp2[100005],a[100005];
vector <ll> d[1000005];
int main(){
    for(long i = 1; i <= 1000000; i++){
        for(long j =2*i; j <= 1000000; j += i){
            d[j].push_back(i);
        }
        d[i].push_back(1);
        if(i != 1){
            d[i].push_back(i);
        }
    }
    ll n;
    cin >> n;
    for(long i = 1; i <= n; i++){
        cin >> a[i];
    }
    dp1[1] = 1;
    for(long i = 2; i <= n; i++){
        for(auto f : d[a[i]]){
            dp1[f] = (dp1[f] + dp2[f-1])%mod;
        }
        for(auto f : d[i]){
            dp2[f] = dp1[f];
        }
    }
    ll sol = 0;
    for(long i = 1; i <= n; i++){
        sol = (sol + dp1[i])%mod;
    }
    cout << sol << endl;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
ll a[100005],dp1[100005],dp2[100005];
vector <ll> d[1000005];
int main(){
    ios_base::sync_with_stdio(false);
    ll n;
    cin >> n;
    for(long i = 1; i <= n; i++){
        cin >> a[i];
    }
    for(long i = 2; i <= 1000000; i++){
        for(long j = 2*i; j <= 1000000; j += i){
            d[j].push_back(i);
        }
        d[i].push_back(1);
        if(i != 1){
            d[i].push_back(i);
        }
    }
    d[1].push_back(1);
    dp2[1] = dp1[1] = dp2[0] = 1;
    for(long i = 2; i <= n; i++){
        for(auto f : d[a[i]]){
            if(f > 100000){
                break;
            }
            dp1[f] = (dp1[f] + dp2[f-1])%mod;
        }
        for(auto f : d[a[i]]){
            if(f > 100000){
                break;
            }
            dp2[f] =  dp1[f];
        }
        //cout << endl << endl;
    }
    ll sol = 0;
    for(long i = 1; i <= n; i++){
        sol = (sol+dp1[i])%mod;
    }
    cout << sol << endl;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
ll dp1[100005],dp2[100005],a[100005];
vector <ll> d[1000005];
int main(){
    for(long i = 1; i <= 1000000; i++){
        for(long j =2*i; j <= 1000000; j += i){
            d[j].push_back(i);
        }
        d[i].push_back(1);
        if(i != 1){
            d[i].push_back(i);
        }
    }
    ll n;
    cin >> n;
    for(long i = 1; i <= n; i++){
        cin >> a[i];
    }
    dp1[1] = 1;
    for(long i = 2; i <= n; i++){
        for(auto f : d[a[i]]){
            dp1[f] = (dp1[f] + dp2[f-1])%mod;
        }
        for(auto f : d[i]){
            dp2[f] = dp1[f];
        }
    }
    ll sol = 0;
    for(long i = 1; i <= n; i++){
        sol = (sol + dp1[i])%mod;
    }
    cout <<() sol+n)%mod << endl;
}


//  main.cpp
//  ervb
//
//  Created by Kanak Gautam on 21/04/20.
//  Copyright © 2020 Kanak Gautam. All rights reserved.
//

#include <iostream>
#include <cstdio>
#include <stdio.h>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <stack>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <utility>
#define pb push_back
#define mk make_pair
#define endl "\n"
#define mod 1000000007
#define PI 3.1415927
using namespace std;
typedef long long int lli;
typedef long double ld;
typedef pair<lli,lli> ii;
//priority_queue <lli, vector<lli>, greater<lli> > ti;
vector <lli> p[250005],f(200005,0) ,b(200005),a(200005),d,e;
//vector<vector<lli>> d(300005,vector<lli>(18,0));
//vector<pair<lli,ii>>p[300005];
//map<pair<lli,lli>,lli>mp;
//vector<pair<pair<lli, lli>,lli> > st;
//map<lli,lli> np;
//queue<lli> qy;
lli gcd(lli a, lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
lli bpow(lli a, lli b) {
    lli res = 1;
    while (b > 0) {
        if (b & 1)
            res = (res * a)%mod;
        a = (a * a)%mod;
        b >>= 1;
    }
    return res%mod;
}
void fact(lli i)
{
    f[0]=1;
    for(lli k=1;k<=i;k++)
    {
        (f[k]=f[k-1]*k)%=mod;
    }
}
lli isprime(lli n)
{
    if(n==1)
        return 0;
    for(lli i=2;i<=sqrt(n);i++)
        if(n%i==0)
            return 0;
    return 1;
}
lli find(lli x)
{
    if(f[x]==x)
        return x;
    else
        return f[x]=find(f[x]);
}
bool cmp(lli x,lli y)
{
    return x<y;
}
lli comb(lli i,lli j)
{
    lli k=f[i];
    lli g=(f[j]*(f[i-j]))%mod;
    lli h=bpow(g,mod-2);
    return (k*h)%mod;
}
/*void sieve()
{
    for(lli i=2;i<=sqrt(10000000);i++)
    {
        if(b[i]==0)
        {
            k.pb(i);
        for(lli j=2;i*j<=sqrt(10000000);j++)
        {
            b[i*j]=1;
        }
        }
    }
}*/
int main ()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    lli n;cin>>n;
    set<lli>s;
    vector<lli> a(n+1);
    for(lli i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    b[0]=1;
    for(lli i=1;i<=n;i++)
    {
        for(lli j=sqrt(a[i]);j>=1;j--)
        {
            if(a[i]%j==0)
            {
                lli k=a[i]/j;
                if(k!=j)
                {
                    (b[k]+=b[k-1])%=mod;
                }
                (b[j]+=b[j-1])%=mod;
            }
        }
    }
    lli sum=0;
    for(lli i=1;i<=1005;i++)
    {
        (sum+=b[i])%=mod;
        //cout<<b[i]<<endl;
    }
    cout<<sum<<endl;
}


//
//  main.cpp
//  ervb
//
//  Created by Kanak Gautam on 21/04/20.
//  Copyright © 2020 Kanak Gautam. All rights reserved.
//

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#define pb push_back
#define mk make_pair
#define endl "\n"
#define mod 1000000007
using namespace std;
typedef long long int lli;
typedef long double ld;
priority_queue <lli, vector<lli>, greater<lli> > ti;
vector <lli> p[300005],f(300005,0),h(300005,0);
vector <char> gh(300005);
map <pair<lli,lli>,lli> mp;
set<pair<lli, lli> > s;
set<lli> st;
map<lli,lli> np,v;
queue<lli> q;
lli gcd(lli a, lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
lli bpow(lli a, lli b) {
    lli res = 1;
    while (b > 0) {
        if (b & 1)
            res = (res * a)%mod;
        a = (a * a)%mod;
        b >>= 1;
    }
    return res%mod;
}
lli fact(lli i)
{
    if(i<=0)
        return 1;
    else
        return (i*fact(i-1))%mod;
}
lli isprime(lli n)
{
    if(n==1)
        return 0;
    for(lli i=2;i<=sqrt(n);i++)
        if(n%i==0)
            return 0;
    return 1;
}
bool cmp(lli i,lli j)
{
    return p[i].size()<p[j].size();
}

/*void sieve()
{
    for(lli i=2;i<=5000000;i++)
    {
        if(b[i]==0)
        {
        for(lli j=2;i*j<=5000000;j++)
        {
            b[i*j]=1;
        }
        }
    }
}*/
int main ()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    lli n;cin>>n;
    vector <lli> a(1000000+1);
    vector <lli> dp(1000000+1);
    lli h;
    dp[0]=1;
    for(lli i=1;i<=n;i++)
    {
        cin>>a[i];
        lli j=a[i];
        for(lli k=1;k<=sqrt(j);k++)
        {
            if(j%k==0)
            (dp[j/k]+=dp[j/k-1])%=mod;
        }
        for(lli k=sqrt(j);k>=1;k--)
        {
            if(k*k!=j && j%k==0 )
            {
                (dp[k]+=dp[k-1])%=mod;
            }
        }
    }
    lli sum=0;
    for(lli i=1;i<=n;i++)
    {
        //cout<<dp[i]<<endl;
        sum+=dp[i]%mod;
        sum%=mod;
    }
    cout<<sum<<endl;
}


//
//  main.cpp
//  ervb
//
//  Created by Kanak Gautam on 21/04/20.
//  Copyright © 2020 Kanak Gautam. All rights reserved.
//

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#define pb push_back
#define mk make_pair
#define endl "\n"
#define mod 1000000007
using namespace std;
typedef long long int lli;
typedef long double ld;
priority_queue <lli, vector<lli>, greater<lli> > ti;
vector <lli> p[300005],f(300005,0),h(300005,0);
vector <char> gh(300005);
map <pair<lli,lli>,lli> mp;
set<pair<lli, lli> > s;
set<lli> st;
map<lli,lli> np,v;
queue<lli> q;
lli gcd(lli a, lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
lli bpow(lli a, lli b) {
    lli res = 1;
    while (b > 0) {
        if (b & 1)
            res = (res * a)%mod;
        a = (a * a)%mod;
        b >>= 1;
    }
    return res%mod;
}
lli fact(lli i)
{
    if(i<=0)
        return 1;
    else
        return (i*fact(i-1))%mod;
}
lli isprime(lli n)
{
    if(n==1)
        return 0;
    for(lli i=2;i<=sqrt(n);i++)
        if(n%i==0)
            return 0;
    return 1;
}
bool cmp(lli i,lli j)
{
    return p[i].size()<p[j].size();
}

/*void sieve()
{
    for(lli i=2;i<=5000000;i++)
    {
        if(b[i]==0)
        {
        for(lli j=2;i*j<=5000000;j++)
        {
            b[i*j]=1;
        }
        }
    }
}*/
int main ()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    lli n;cin>>n;
    vector <lli> a(n+1);
    vector <lli> dp(n+1);
    lli h;
    dp[0]=1;
    for(lli i=1;i<=n;i++)
    {
        cin>>a[i];
        lli j=a[i];
        for(lli k=1;k<=sqrt(j);k++)
        {
            if(j%k==0 && j/k<=n)
            (dp[j/k]+=dp[j/k-1])%=mod;
        }
        for(lli k=sqrt(j);k>=1;k--)
        {
            if(k*k!=j && j%k==0 && j<=n)
            {
                (dp[k]+=dp[k-1])%=mod;
            }
        }
    }
    lli sum=0;
    for(lli i=1;i<=n;i++)
    {
        //cout<<dp[i]<<endl;
        sum+=dp[i]%mod;
        sum%=mod;
    }
    cout<<sum<<endl;
}


//  main.cpp
//  ervb
//
//  Created by Kanak Gautam on 21/04/20.
//  Copyright © 2020 Kanak Gautam. All rights reserved.
//

#include <iostream>
#include <cstdio>
#include <stdio.h>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <stack>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <utility>
#define pb push_back
#define mk make_pair
#define endl "\n"
#define mod 1000000007
#define PI 3.1415927
using namespace std;
typedef long long int lli;
typedef long double ld;
typedef pair<lli,lli> ii;
//priority_queue <lli, vector<lli>, greater<lli> > ti;
vector <lli> p[250005],f(200005,0) ,b(1000005),a(200005),d,e;
//vector<vector<lli>> d(300005,vector<lli>(18,0));
//vector<pair<lli,ii>>p[300005];
//map<pair<lli,lli>,lli>mp;
//vector<pair<pair<lli, lli>,lli> > st;
//map<lli,lli> np;
//queue<lli> qy;
lli gcd(lli a, lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
lli bpow(lli a, lli b) {
    lli res = 1;
    while (b > 0) {
        if (b & 1)
            res = (res * a)%mod;
        a = (a * a)%mod;
        b >>= 1;
    }
    return res%mod;
}
void fact(lli i)
{
    f[0]=1;
    for(lli k=1;k<=i;k++)
    {
        (f[k]=f[k-1]*k)%=mod;
    }
}
lli isprime(lli n)
{
    if(n==1)
        return 0;
    for(lli i=2;i<=sqrt(n);i++)
        if(n%i==0)
            return 0;
    return 1;
}
lli find(lli x)
{
    if(f[x]==x)
        return x;
    else
        return f[x]=find(f[x]);
}
bool cmp(lli x,lli y)
{
    return x<y;
}
lli comb(lli i,lli j)
{
    lli k=f[i];
    lli g=(f[j]*(f[i-j]))%mod;
    lli h=bpow(g,mod-2);
    return (k*h)%mod;
}
/*void sieve()
{
    for(lli i=2;i<=sqrt(10000000);i++)
    {
        if(b[i]==0)
        {
            k.pb(i);
        for(lli j=2;i*j<=sqrt(10000000);j++)
        {
            b[i*j]=1;
        }
        }
    }
}*/
int main ()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    lli n;cin>>n;
    set<lli>s;
    vector<lli> a(n+1);
    for(lli i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    b[0]=1;
    for(lli i=1;i<=n;i++)
    {
        for(lli j=sqrt(a[i]);j>=1;j--)
        {
            if(a[i]%j==0)
            {
                lli k=a[i]/j;
                if(k!=j)
                {
                    (b[k]+=b[k-1])%=mod;
                }
                (b[j]+=b[j-1])%=mod;
            }
        }
    }
    lli sum=0;
    for(lli i=1;i<1000005;i++)
    {
        (sum+=b[i])%=mod;
        //cout<<b[i]<<endl;
    }
    cout<<sum<<endl;
}


//
//  main.cpp
//  ervb
//
//  Created by Kanak Gautam on 21/04/20.
//  Copyright © 2020 Kanak Gautam. All rights reserved.
//

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#define pb push_back
#define mk make_pair
#define endl "\n"
#define mod 1000000007
using namespace std;
typedef long long int lli;
typedef long double ld;
priority_queue <lli, vector<lli>, greater<lli> > ti;
vector <lli> p[300005],f(300005,0),h(300005,0);
vector <char> gh(300005);
map <pair<lli,lli>,lli> mp;
set<pair<lli, lli> > s;
set<lli> st;
map<lli,lli> np,v;
queue<lli> q;
lli gcd(lli a, lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
lli bpow(lli a, lli b) {
    lli res = 1;
    while (b > 0) {
        if (b & 1)
            res = (res * a)%mod;
        a = (a * a)%mod;
        b >>= 1;
    }
    return res%mod;
}
lli fact(lli i)
{
    if(i<=0)
        return 1;
    else
        return (i*fact(i-1))%mod;
}
lli isprime(lli n)
{
    if(n==1)
        return 0;
    for(lli i=2;i<=sqrt(n);i++)
        if(n%i==0)
            return 0;
    return 1;
}
bool cmp(lli i,lli j)
{
    return p[i].size()<p[j].size();
}

/*void sieve()
{
    for(lli i=2;i<=5000000;i++)
    {
        if(b[i]==0)
        {
        for(lli j=2;i*j<=5000000;j++)
        {
            b[i*j]=1;
        }
        }
    }
}*/
int main ()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    lli n;cin>>n;
    vector <lli> a(n+1);
    vector <lli> dp(n+1);
    lli h;
    dp[0]=1;
    for(lli i=1;i<=n;i++)
    {
        cin>>a[i];
        lli j=a[i];
        for(lli k=min((lli)sqrt(j),n);k>=1;k--)
        {
            if(j%k==0)
            {
                h=j/k;
                dp[k]+=dp[k-1]%mod;
                dp[k]%=mod;
                if(h<=n && h!=k)
                {
                    if(j%(h-1)!=0)
                    {
                        dp[h]+=dp[h-1]%mod;
                        dp[h]%=mod;
                    }
                    else
                    {
                        dp[h]=(dp[h-1]-1)%mod;
                        dp[h]%=mod;
                    }
                }
            }
        }
    }
    lli sum=0;
    for(lli i=1;i<=n;i++)
    {
        //cout<<dp[i]<<endl;
        sum+=dp[i]%mod;
        sum%=mod;
    }
    cout<<sum<<endl;
}


//
//  main.cpp
//  ervb
//
//  Created by Kanak Gautam on 21/04/20.
//  Copyright © 2020 Kanak Gautam. All rights reserved.
//

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#define pb push_back
#define mk make_pair
#define endl "\n"
#define mod 1000000007
using namespace std;
typedef long long int lli;
typedef long double ld;
priority_queue <lli, vector<lli>, greater<lli> > ti;
vector <lli> p[300005],f(300005,0),h(300005,0);
vector <char> gh(300005);
map <pair<lli,lli>,lli> mp;
set<pair<lli, lli> > s;
set<lli> st;
map<lli,lli> np,v;
queue<lli> q;
lli gcd(lli a, lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
lli bpow(lli a, lli b) {
    lli res = 1;
    while (b > 0) {
        if (b & 1)
            res = (res * a)%mod;
        a = (a * a)%mod;
        b >>= 1;
    }
    return res%mod;
}
lli fact(lli i)
{
    if(i<=0)
        return 1;
    else
        return (i*fact(i-1))%mod;
}
lli isprime(lli n)
{
    if(n==1)
        return 0;
    for(lli i=2;i<=sqrt(n);i++)
        if(n%i==0)
            return 0;
    return 1;
}
bool cmp(lli i,lli j)
{
    return p[i].size()<p[j].size();
}

/*void sieve()
{
    for(lli i=2;i<=5000000;i++)
    {
        if(b[i]==0)
        {
        for(lli j=2;i*j<=5000000;j++)
        {
            b[i*j]=1;
        }
        }
    }
}*/
int main ()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    lli n;cin>>n;
    vector <lli> a(n+1);
    vector <lli> dp(n+1);
    lli h;
    dp[0]=1;
    for(lli i=1;i<=n;i++)
    {
        cin>>a[i];
        lli j=a[i];
        for(lli k=1;k<=sqrt(j);k++)
        {
            if(j%k==0)
            (dp[j/k]+=dp[j/k-1])%=mod;
        }
        for(lli k=sqrt(j);k>=1;k--)
        {
            if(k*k!=j && j%k==0)
            {
                (dp[k]+=dp[k-1])%=mod;
            }
        }
    }
    lli sum=0;
    for(lli i=1;i<=n;i++)
    {
        //cout<<dp[i]<<endl;
        sum+=dp[i]%mod;
        sum%=mod;
    }
    cout<<sum<<endl;
}


//
//  main.cpp
//  ervb
//
//  Created by Kanak Gautam on 21/04/20.
//  Copyright © 2020 Kanak Gautam. All rights reserved.
//

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#define pb push_back
#define mk make_pair
#define endl "\n"
#define mod 1000000007
using namespace std;
typedef long long int lli;
typedef long double ld;
priority_queue <lli, vector<lli>, greater<lli> > ti;
vector <lli> p[300005],f(300005,0),h(300005,0);
vector <char> gh(300005);
map <pair<lli,lli>,lli> mp;
set<pair<lli, lli> > s;
set<lli> st;
map<lli,lli> np,v;
queue<lli> q;
lli gcd(lli a, lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
lli bpow(lli a, lli b) {
    lli res = 1;
    while (b > 0) {
        if (b & 1)
            res = (res * a)%mod;
        a = (a * a)%mod;
        b >>= 1;
    }
    return res%mod;
}
lli fact(lli i)
{
    if(i<=0)
        return 1;
    else
        return (i*fact(i-1))%mod;
}
lli isprime(lli n)
{
    if(n==1)
        return 0;
    for(lli i=2;i<=sqrt(n);i++)
        if(n%i==0)
            return 0;
    return 1;
}
bool cmp(lli i,lli j)
{
    return p[i].size()<p[j].size();
}

/*void sieve()
{
    for(lli i=2;i<=5000000;i++)
    {
        if(b[i]==0)
        {
        for(lli j=2;i*j<=5000000;j++)
        {
            b[i*j]=1;
        }
        }
    }
}*/
int main ()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    lli n;cin>>n;
    vector <lli> a(n+1);
    vector <lli> dp(n+1);
    lli h;
    dp[0]=1;
    for(lli i=1;i<=n;i++)
    {
        cin>>a[i];
        lli j=a[i];
        for(lli k=min((lli)sqrt(j),n);k>=1;k--)
        {
            if(j%k==0)
            {
                h=j/k;
                (dp[k]+=dp[k-1])%=mod;
                if(h<=n && h!=k)
                {
                    if(j%(h-1)!=0)
                        (dp[h]+=dp[h-1])%=mod;
                    else
                        (dp[h]=dp[h-1]-1)%=mod;
                }
            }
        }
    }
    lli sum=0;
    for(lli i=1;i<=n;i++)
    {
        //cout<<dp[i]<<endl;
        (sum+=dp[i])%=mod;
    }
    cout<<sum<<endl;
}


//
//  main.cpp
//  ervb
//
//  Created by Kanak Gautam on 21/04/20.
//  Copyright © 2020 Kanak Gautam. All rights reserved.
//

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#define pb push_back
#define mk make_pair
#define endl "\n"
#define mod 1000000007
using namespace std;
typedef long long int lli;
typedef long double ld;
priority_queue <lli, vector<lli>, greater<lli> > ti;
vector <lli> p[300005],f(300005,0),h(300005,0);
vector <char> gh(300005);
map <pair<lli,lli>,lli> mp;
set<pair<lli, lli> > s;
set<lli> st;
map<lli,lli> np,v;
queue<lli> q;
lli gcd(lli a, lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
lli bpow(lli a, lli b) {
    lli res = 1;
    while (b > 0) {
        if (b & 1)
            res = (res * a)%mod;
        a = (a * a)%mod;
        b >>= 1;
    }
    return res%mod;
}
lli fact(lli i)
{
    if(i<=0)
        return 1;
    else
        return (i*fact(i-1))%mod;
}
lli isprime(lli n)
{
    if(n==1)
        return 0;
    for(lli i=2;i<=sqrt(n);i++)
        if(n%i==0)
            return 0;
    return 1;
}
bool cmp(lli i,lli j)
{
    return p[i].size()<p[j].size();
}

/*void sieve()
{
    for(lli i=2;i<=5000000;i++)
    {
        if(b[i]==0)
        {
        for(lli j=2;i*j<=5000000;j++)
        {
            b[i*j]=1;
        }
        }
    }
}*/
int main ()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    lli n;cin>>n;
    vector <lli> a(n+1);
    vector <lli> dp(n+1);
    lli h;
    dp[0]=1;
    for(lli i=1;i<=n;i++)
    {
        cin>>a[i];
        lli j=a[i];
        for(lli k=1;k<=sqrt(j);k++)
        {
            if(j%k==0)
            (dp[j/k]+=dp[j/k-1])%=mod;
        }
        for(lli k=sqrt(j);k>=1;k++)
        {
            if(k*k!=j && j%k==0)
            {
                (dp[k]+=dp[k-1])%=mod;
            }
        }
    }
    lli sum=0;
    for(lli i=1;i<=n;i++)
    {
        //cout<<dp[i]<<endl;
        sum+=dp[i]%mod;
        sum%=mod;
    }
    cout<<sum<<endl;
}


#pragma gcc optimize("Ofast")
#include<bits/stdc++.h>
#define int long long
#define IOS ios::sync_with_stdio(0); cin.tie(0);
#define endl '\n'
#define pi pair<int,int>
#define pb emplace_back
#define SZ(v) (int)(v).size()
#define all(v) (v).begin(),(v).end()
#define REP(i, j, k) for(int i = j; i < k; ++i)
#define debug(a) cout << #a << " = " << a << endl;
#define MOD 1000000009LL

inline void input(int &_x)
{
    _x = 0;
    int _tmp = 1; char _tc = getchar();
    while((_tc < '0' || _tc > '9') && _tc != '-') _tc = getchar();
    if(_tc == '-') _tc = getchar(), _tmp = -1;
    while(_tc >= '0' && _tc <= '9') _x = _x*10+(_tc-48), _tc = getchar();
    _x *= _tmp;
}
using namespace std;
int n;
vector<int> u[1000009];
int dp[1000009];
signed main()
{
	REP(i, 1, 1000001)
		for(int j = i; j <= 1000000; j += i)
			u[j].pb(i);
	input(n);
	vector<int> v(n);
	for(auto &i:v) input(i);
	dp[0] = 1;
	for(auto i:v) for(int j = SZ(u[i]) - 1; j >= 0; --j)
		dp[u[i][j]] = (dp[u[i][j]] + dp[u[i][j] - 1]) % MOD;
	int ans = 0;
	for(int i = 1; i <= n; ++i) ans = (ans + dp[i]) % MOD;
	cout << ans;
}


#pragma gcc optimize("Ofast")
#include<bits/stdc++.h>
#define int long long
#define IOS ios::sync_with_stdio(0); cin.tie(0);
#define endl '\n'
#define pi pair<int,int>
#define pb emplace_back
#define SZ(v) (int)(v).size()
#define all(v) (v).begin(),(v).end()
#define REP(i, j, k) for(int i = j; i < k; ++i)
#define debug(a) cout << #a << " = " << a << endl;
#define MOD 1000000009LL

inline void input(int &_x)
{
    _x = 0;
    int _tmp = 1; char _tc = getchar();
    while((_tc < '0' || _tc > '9') && _tc != '-') _tc = getchar();
    if(_tc == '-') _tc = getchar(), _tmp = -1;
    while(_tc >= '0' && _tc <= '9') _x = _x*10+(_tc-48), _tc = getchar();
    _x *= _tmp;
}
using namespace std;
int n;
vector<int> u[1000009];
int dp[1000009];
signed main()
{
	REP(i, 1, 1000001LL)
		for(int j = i; j <= 1000000LL; j += i)
			u[j].pb(i);
	input(n);
	vector<int> v(n);
	REP(i, 0, n) input(v[i]);
	dp[0] = 1LL;
	for(auto i:v) for(int j = SZ(u[i]) - 1; j >= 0; --j)
		dp[u[i][j]] = (dp[u[i][j]] + dp[u[i][j] - 1]) % MOD;
	int ans = 0;
	for(int i = 1; i <= 1000000LL; ++i) ans = (ans + dp[i]) % MOD;
	printf("%lld", ans);
}


#pragma gcc optimize("Ofast")
#include<bits/stdc++.h>
#define int long long
#define IOS ios::sync_with_stdio(0); cin.tie(0);
#define endl '\n'
#define pi pair<int,int>
#define pb emplace_back
#define SZ(v) (int)(v).size()
#define all(v) (v).begin(),(v).end()
#define REP(i, j, k) for(int i = j; i < k; ++i)
#define debug(a) cout << #a << " = " << a << endl;
using namespace std;
int n;
map<int,vector<int> > m;
int dp[1000009];
signed main()
{IOS
	cin >> n;
	vector<int> v(n + 1);
	REP(i, 1, n + 1) cin >> v[i];
	REP(i, 1, n + 1)
		for(int j = i; j <= 1000000; j += i)
			m[j].pb(i);
	//for(auto &i:m) reverse(all(i.second));
	dp[0] = 1;
	REP(i, 1, n + 1) for(int j = SZ(m[v[i]]) - 1; j >= 0; --j)
		dp[m[v[i]][j]] += dp[m[v[i]][j] - 1];
	cout << accumulate(dp + 1, dp + n + 1, 0LL, plus<int>());
}


#pragma gcc optimize("Ofast")
#include<bits/stdc++.h>
#define int long long
#define IOS ios::sync_with_stdio(0); cin.tie(0);
#define endl '\n'
#define pi pair<int,int>
#define pb emplace_back
#define SZ(v) (int)(v).size()
#define all(v) (v).begin(),(v).end()
#define REP(i, j, k) for(int i = j; i < k; ++i)
#define debug(a) cout << #a << " = " << a << endl;
#define MOD 1000000009LL

inline void input(int &_x)
{
    _x = 0;
    int _tmp = 1; char _tc = getchar();
    while((_tc < '0' || _tc > '9') && _tc != '-') _tc = getchar();
    if(_tc == '-') _tc = getchar(), _tmp = -1;
    while(_tc >= '0' && _tc <= '9') _x = _x*10+(_tc-48), _tc = getchar();
    _x *= _tmp;
}
using namespace std;
int n;
vector<int> u[1000009];
int dp[1000009];
signed main()
{
	REP(i, 1, 1000001)
		for(int j = i; j <= 1000000; j += i)
			u[j].pb(i);
	input(n);
	vector<int> v(n);
	for(auto &i:v) input(i);
	dp[0] = 1;
	for(auto i:v) for(int j = SZ(u[i]) - 1; j >= 0; --j)
		dp[u[i][j]] = (dp[u[i][j]] + dp[u[i][j] - 1]) % MOD;
	int ans = 0;
	for(int i = 1; i <= 1000000; ++i) ans = (ans + dp[i]) % MOD;
	printf("%d", ans);
}


#pragma gcc optimize("Ofast")
#include<bits/stdc++.h>
#define int long long
#define IOS ios::sync_with_stdio(0); cin.tie(0);
#define endl '\n'
#define pi pair<int,int>
#define pb emplace_back
#define SZ(v) (int)(v).size()
#define all(v) (v).begin(),(v).end()
#define REP(i, j, k) for(int i = j; i < k; ++i)
#define debug(a) cout << #a << " = " << a << endl;
#define MOD 1000000009LL

inline void input(int &_x)
{
    _x = 0;
    int _tmp = 1; char _tc = getchar();
    while((_tc < '0' || _tc > '9') && _tc != '-') _tc = getchar();
    if(_tc == '-') _tc = getchar(), _tmp = -1;
    while(_tc >= '0' && _tc <= '9') _x = _x*10+(_tc-48), _tc = getchar();
    _x *= _tmp;
}
using namespace std;
int n;
vector<int> u[1000009];
int dp[1000009];
signed main()
{
	REP(i, 1, 1000001)
		for(int j = i; j <= 1000000; j += i)
			u[j].pb(i);
	input(n);
	vector<int> v(n);
	for(auto &i:v) input(i);
	dp[0] = 1;
	for(auto i:v) for(int j = SZ(u[i]) - 1; j >= 0; --j)
		dp[u[i][j]] = (dp[u[i][j]] + dp[u[i][j] - 1]) % MOD;
	int ans = 0;
	for(int i = 1; i <= 1000000; ++i) ans = (ans + dp[i]) % MOD;
	printf("%lld", ans);
}


#pragma gcc optimize("Ofast")
#include<bits/stdc++.h>
#define int long long
#define IOS ios::sync_with_stdio(0); cin.tie(0);
#define endl '\n'
#define pi pair<int,int>
#define pb emplace_back
#define SZ(v) (int)(v).size()
#define all(v) (v).begin(),(v).end()
#define REP(i, j, k) for(int i = j; i < k; ++i)
#define debug(a) cout << #a << " = " << a << endl;
#define MOD 1000000009LL

inline void input(int &_x)
{
    _x = 0;
    int _tmp = 1; char _tc = getchar();
    while((_tc < '0' || _tc > '9') && _tc != '-') _tc = getchar();
    if(_tc == '-') _tc = getchar(), _tmp = -1;
    while(_tc >= '0' && _tc <= '9') _x = _x*10+(_tc-48), _tc = getchar();
    _x *= _tmp;
}
using namespace std;
int n;
vector<int> u[1000009];
int dp[1000009];
signed main()
{
	REP(i, 1, 1000001)
		for(int j = i; j <= 1000000; j += i)
			u[j].pb(i);
	input(n);
	vector<int> v(n);
	for(auto &i:v) input(i);
	dp[0] = 1;
	for(auto i:v) for(int j = SZ(u[i]) - 1; j >= 0; --j)
		dp[u[i][j]] = (dp[u[i][j]] + dp[u[i][j] - 1]) % MOD;
	cout << accumulate(dp + 1, dp + n + 1, 0LL, plus<int>());
}


#pragma gcc optimize("Ofast")
#include<bits/stdc++.h>
#define int long long
#define IOS ios::sync_with_stdio(0); cin.tie(0);
#define endl '\n'
#define pi pair<int,int>
#define pb emplace_back
#define SZ(v) (int)(v).size()
#define all(v) (v).begin(),(v).end()
#define REP(i, j, k) for(int i = j; i < k; ++i)
#define debug(a) cout << #a << " = " << a << endl;
#define MOD 1000000007LL

inline void input(int &_x)
{
    _x = 0;
    int _tmp = 1; char _tc = getchar();
    while((_tc < '0' || _tc > '9') && _tc != '-') _tc = getchar();
    if(_tc == '-') _tc = getchar(), _tmp = -1;
    while(_tc >= '0' && _tc <= '9') _x = _x*10+(_tc-48), _tc = getchar();
    _x *= _tmp;
}
using namespace std;
int n;
vector<int> u[1000009];
int dp[1000009];
signed main()
{
	REP(i, 1, 1000001LL)
		for(int j = i; j <= 1000000LL; j += i)
			u[j].pb(i);
	input(n);
	vector<int> v(n);
	REP(i, 0, n) input(v[i]);
	dp[0] = 1LL;
	for(auto i:v) for(int j = SZ(u[i]) - 1; j >= 0; --j)
		dp[u[i][j]] = (dp[u[i][j]] + dp[u[i][j] - 1]) % MOD;
	int ans = 0;
	for(int i = 1; i <= 1000000LL; ++i) ans = (ans + dp[i]) % MOD;
	printf("%lld", ans);
}


#pragma gcc optimize("Ofast")
#include<bits/stdc++.h>
#define int long long
#define IOS ios::sync_with_stdio(0); cin.tie(0);
#define endl '\n'
#define pi pair<int,int>
#define pb emplace_back
#define SZ(v) (int)(v).size()
#define all(v) (v).begin(),(v).end()
#define REP(i, j, k) for(int i = j; i < k; ++i)
#define debug(a) cout << #a << " = " << a << endl;
#define MOD 1000000009LL
#define getchar getchar_unlocked

inline void input(int &_x)
{
    _x = 0;
    int _tmp = 1; char _tc = getchar();
    while((_tc < '0' || _tc > '9') && _tc != '-') _tc = getchar();
    if(_tc == '-') _tc = getchar(), _tmp = -1;
    while(_tc >= '0' && _tc <= '9') _x = _x*10+(_tc-48), _tc = getchar();
    _x *= _tmp;
}
using namespace std;
int n;
vector<int> u[1000009];
int dp[1000009];
signed main()
{
	REP(i, 1, 1000001)
		for(int j = i; j <= 1000000; j += i)
			u[j].pb(i);
	input(n);
	vector<int> v(n);
	for(auto &i:v) input(i);
	dp[0] = 1;
	for(auto i:v) for(int j = SZ(u[i]) - 1; j >= 0; --j)
		dp[u[i][j]] = (dp[u[i][j]] + dp[u[i][j] - 1]) % MOD;
	cout << accumulate(dp + 1, dp + n + 1, 0LL, plus<int>());
}


#include<bits/stdc++.h>
#include<bits/stdc++.h>
#include <vector>
#define ll long long int
#define ve vector<int>
#define pb push_back
#define mod 1000000007
#define INF 9e18+7
using namespace std;
ll dp[200005];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;cin>>n;
ll a[n];
for(int i=0;i<n;i++)
cin>>a[i];

dp[0]=0;
for(int i=0;i<=200000;i++)
dp[i]=0;

for(ll i=0;i<n;i++)
{
	int b=0;
	for(ll j=2;j*j<=a[i];j++)
	{
		if(a[i]%j==0)
		{
			b=1;
			if(j*j!=a[i]&&a[i]/j<=n)
			{
				dp[a[i]/j]=(dp[a[i]/j]+dp[a[i]/j-1])%mod;
			}
			dp[j]=(dp[j-1]+dp[j])%mod;
		}
	}
	if(b==0)
	{
		if(a[i]<=n)
		dp[a[i]]=(dp[a[i]-1]+dp[a[i]])%mod;
	}
	dp[1]++;
}

ll ans=0;
for(int i=1;i<=n;i++)
{
	ans=(ans+dp[i])%mod;
}
cout<<ans<<endl;

}


#include<bits/stdc++.h>
#include<bits/stdc++.h>
#include <vector>
#define ll long long int
#define ve vector<int>
#define pb push_back
#define mod 1000000007
#define INF 9e18+7
using namespace std;
ll dp[200005];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;cin>>n;
ll a[n];
for(int i=0;i<n;i++)
cin>>a[i];

dp[0]=0;
for(int i=0;i<=200000;i++)
dp[i]=0;

for(ll i=0;i<n;i++)
{
	for(ll j=2;j*j<=a[i];j++)
	{
		if(a[i]%j==0)
		{
			if(j*j!=a[i]&&a[i]/j<=n)
			{
				dp[a[i]/j]=(dp[a[i]/j]+dp[a[i]/j-1])%mod;
			}
			dp[j]=(dp[j-1]+dp[j])%mod;
		}
	}
	if(a[i]<=n)
	dp[a[i]]=(dp[a[i]-1]+dp[a[i]])%mod;

	dp[1]++;
}

ll ans=0;
for(int i=1;i<=n;i++)
{
	ans=(ans+dp[i])%mod;
}
cout<<ans<<endl;

}


#include<bits/stdc++.h>
#include<bits/stdc++.h>
#include <vector>
#define ll long long int
#define ve vector<int>
#define pb push_back
#define mod 1000000007
#define INF 9e18+7
using namespace std;
ll dp[200005];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;cin>>n;
ll a[n];
for(int i=0;i<n;i++)
cin>>a[i];

dp[0]=0;
for(int i=0;i<=200000;i++)
dp[i]=0;

for(ll i=0;i<n;i++)
{
	if(a[i]<=n)
	dp[a[i]]=(dp[a[i]-1]+dp[a[i]])%mod;
	for(ll j=2;j*j<=a[i];j++)
	{
		if(a[i]%j==0)
		{
			if(j*j!=a[i]&&a[i]/j<=n)
			{
				dp[a[i]/j]=(dp[a[i]/j]+dp[a[i]/j-1])%mod;
			}
			dp[j]=(dp[j-1]+dp[j])%mod;
		}
	}
	dp[1]++;
}

ll ans=0;
for(int i=1;i<=n;i++)
{
	ans=(ans+dp[i])%mod;
}
cout<<ans<<endl;

}


#include<bits/stdc++.h>
#include<bits/stdc++.h>
#include <vector>
#define ll long long int
#define ve vector<int>
#define pb push_back
#define mod 1000000007
#define INF 9e18+7
using namespace std;
ll dp[200005];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;cin>>n;
ll a[n];
for(int i=0;i<n;i++)
cin>>a[i];
for(int i=0;i<=100001;i++)
dp[i]=0;

for(ll i=0;i<n;i++)
{
	vector<ll>fac;
	fac.pb(a[i]);
	for(ll j=2;j*j<=a[i];j++)
	{
		if(a[i]%j==0)
		{
			fac.pb(j);
			if(j!=a[i]/j)
			fac.pb(a[i]/j);
		}
	}
	sort(fac.begin(),fac.end());
	for(int i=fac.size()-1;i>0;i--)
	{
		if(fac[i]<=n)
		dp[fac[i]]=(dp[fac[i]-1]+dp[fac[i]])%mod;
	}
	dp[1]++;
}
ll ans=0;
for(int i=1;i<=n;i++)
{
	ans=(ans+dp[i])%mod;
}
cout<<ans;

}


#include<bits/stdc++.h>
#include<bits/stdc++.h>
#include <vector>
#define ll long long int
#define ve vector<int>
#define pb push_back
#define mod 1000000007
#define INF 9e18+7
using namespace std;
ll dp[200005];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;cin>>n;
ll a[n];
for(int i=0;i<n;i++)
cin>>a[i];

dp[0]=0;
for(int i=0;i<=200000;i++)
dp[i]=0;

for(int i=0;i<n;i++)
{
	int b=0;
	for(int j=2;j*j<=a[i];j++)
	{
		if(a[i]%j==0)
		{
			b=1;
			dp[j]=(dp[j-1]+dp[j])%mod;
			if(a[i]/j<=n)
			{
				dp[a[i]/j]=(dp[a[i]/j]+dp[a[i]/j-1])%mod;
			}
		}
	}
	if(b==0)
	{
		if(a[i]<=n)
		dp[a[i]]=(dp[a[i]-1]+dp[a[i]])%mod;
	}
	dp[1]++;
}

ll ans=0;
for(int i=1;i<=n;i++)
{
	ans=(ans+dp[i])%mod;
}
cout<<ans<<endl;

}


#include<bits/stdc++.h>
#include<bits/stdc++.h>
#include <vector>
#define ll long long int
#define ve vector<int>
#define pb push_back
#define mod 1000000007
#define INF 9e18+7
using namespace std;
ll dp[200005];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;cin>>n;
ll a[n];
for(int i=0;i<n;i++)
cin>>a[i];
for(int i=0;i<=100001;i++)
dp[i]=0;

for(ll i=0;i<n;i++)
{
	vector<ll>fac;
	fac.pb(1);
	fac.pb(a[i]);
	for(ll j=2;j*j<=a[i];j++)
	{
		if(a[i]%j==0)
		{
			fac.pb(j);
			if(j!=a[i]/j)
			fac.pb(a[i]/j);
		}
	}
	sort(fac.begin(),fac.end());
	for(int j=fac.size()-1;j>0;j--)
	{
		if(fac[j]<=n)
		dp[fac[j]]=(dp[fac[j]-1]+dp[fac[j]])%mod;
	}
	dp[1]++;
}
ll ans=0;
for(int i=1;i<=n;i++)
{
	ans=(ans+dp[i])%mod;
}
cout<<ans;

}


#include<bits/stdc++.h>
#include<bits/stdc++.h>
#include <vector>
#define ll long long int
#define ve vector<int>
#define pb push_back
#define mod 1000000007
#define INF 9e18+7
using namespace std;
ll dp[200001];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;cin>>n;
ll a[n];
for(int i=0;i<n;i++)
cin>>a[i];

dp[0]=0;
for(int i=0;i<n;i++)
{
	int b=0;
	for(int j=2;j*j<=a[i];j++)
	{
		if(a[i]%j==0)
		{
			b=1;
			dp[j]=(dp[j-1]+dp[j])%mod;
			if(a[i]/j<=n)
			{
				dp[a[i]/j]=(dp[a[i]/j]+dp[a[i]/j-1])%mod;
			}
		}
	}
	if(b==0)
	{
		dp[a[i]]=(dp[a[i]-1]+dp[a[i]])%mod;
	}
	dp[1]++;
}

ll ans=0;
for(int i=1;i<=n;i++)
{
	ans=(ans+dp[i])%mod;
}
cout<<ans<<endl;

}


#include<bits/stdc++.h>
#include<bits/stdc++.h>
#include <vector>
#define ll long long int
#define ve vector<int>
#define pb push_back
#define mod 1000000007
#define INF 9e18+7
using namespace std;
ll dp[200005];
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;cin>>n;
ll a[n];
for(int i=0;i<n;i++)
cin>>a[i];
for(int i=0;i<=100001;i++)
dp[i]=0;

for(ll i=0;i<n;i++)
{
	vector<ll>fac;
	fac.pb(1);
	fac.pb(a[i]);
	for(ll j=2;j*j<=a[i];j++)
	{
		if(a[i]%j==0)
		{
			fac.pb(j);
			fac.pb(a[i]/j);
		}
	}
	sort(fac.begin(),fac.end());
	for(int i=fac.size()-1;i>0;i--)
	{
		if(fac[i]<=n)
		dp[fac[i]]=(dp[fac[i]-1]+dp[fac[i]])%mod;
	}
	dp[1]++;
}
ll ans=0;
for(int i=1;i<=n;i++)
{
	ans=(ans+dp[i])%mod;
}
cout<<ans;

}


#include <bits/stdc++.h>
#include<math.h>
using namespace std;
#define int long long int
#define endl "\n"
#define PI 3.14159265
int MAXN = 5000001;
const int mod=1000000009;
const int INF =LONG_LONG_MAX;
inline int gcd(int a,int b){if(a==0) return b;return gcd(b%a,a);}
inline int pow(int a,int n,int mod){if(n==0)return 1;int p=pow(a,n/2,mod);p=(p%mod*p%mod)%mod;if(n%2) return (p%mod*a%mod)%mod;else return p;}
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)cin>>a[i];
    vector<int>ans(n+1,0);

    for(int i=0;i<n;i++)
    {
        int d=a[i];

        for(int j=1;j*j<=d;j++)
        {
            if(d%j==0)
            {
                int d1=j;
                ans[d1]+=ans[d1-1];
                if(j!=d/j)
                    ans[d/j]+=ans[(d/j)-1];
            }
        }
        ans[1]++;
    }
    int cnt=0;
    for(int i=1;i<=n;i++)
        cnt+=ans[i];
        cout<<cnt<<endl;

}


#include <bits/stdc++.h>
#include<math.h>
using namespace std;
#define int long long int
#define endl "\n"
#define PI 3.14159265
int MAXN = 5000001;
const int mod=1000000009;
const int INF =LONG_LONG_MAX;
inline int gcd(int a,int b){if(a==0) return b;return gcd(b%a,a);}
inline int pow(int a,int n,int mod){if(n==0)return 1;int p=pow(a,n/2,mod);p=(p%mod*p%mod)%mod;if(n%2) return (p%mod*a%mod)%mod;else return p;}
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)cin>>a[i];
    vector<int>ans(1000001,0);

    for(int i=0;i<n;i++)
    {
        int d=a[i];

        for(int j=sqrt(d);j>=1;j--)
        {
            if(d%j==0)
            {
                int d1=j;
                ans[d1]+=ans[d1-1];
                if(j!=(d/j))
                    ans[(d/j)]+=ans[(d/j)-1];
            }
        }

        ans[1]++;
        // for(int i=0;i<=n;i++)
        //cout<<ans[i]<<" ";
        //cout<<endl;
    }
    //for(int i=0;i<=n;i++)
      //  cout<<ans[i]<<" ";
    int cnt=0;
    for(int i=1;i<=n;i++)
        cnt+=ans[i];
        cout<<cnt<<endl;

}


#include <bits/stdc++.h>
#include<math.h>
using namespace std;
#define int long long int
#define endl "\n"
#define PI 3.14159265
int MAXN = 5000001;
const int mod=1000000009;
const int INF =LONG_LONG_MAX;
inline int gcd(int a,int b){if(a==0) return b;return gcd(b%a,a);}
inline int pow(int a,int n,int mod){if(n==0)return 1;int p=pow(a,n/2,mod);p=(p%mod*p%mod)%mod;if(n%2) return (p%mod*a%mod)%mod;else return p;}
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)cin>>a[i];
    vector<int>ans(1000001,0);

    for(int i=0;i<n;i++)
    {
        int d=a[i];

        for(int j=1;j*j<=d;j++)
        {
            if(d%j==0)
            {
                int d1=j;
                ans[d1]+=ans[d1-1];
                if(j!=d/j)
                    ans[d/j]+=ans[(d/j)-1];
            }
        }
        ans[1]++;
    }
    int cnt=0;
    for(int i=1;i<=n;i++)
        cnt+=ans[i];
        cout<<cnt<<endl;

}


#include <bits/stdc++.h>
#include<math.h>
using namespace std;
#define int long long int
#define endl "\n"
#define PI 3.14159265
int MAXN = 5000001;
const int mod=1000000007;
const int INF =LONG_LONG_MAX;
inline int gcd(int a,int b){if(a==0) return b;return gcd(b%a,a);}
inline int pow(int a,int n,int mod){if(n==0)return 1;int p=pow(a,n/2,mod);p=(p%mod*p%mod)%mod;if(n%2) return (p%mod*a%mod)%mod;else return p;}
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)cin>>a[i];
    vector<int>ans(1000001,0);

    for(int i=0;i<n;i++)
    {
        int d=a[i];

        for(int j=sqrt(d);j>=1;j--)
        {
            if(d%j==0)
            {
                int d1=j;
                ans[d1]=(ans[d1]%mod+ans[d1-1]%mod)%mod;
                if(j!=(d/j))
                 ans[(d/j)]=(ans[(d/j)]%mod+ans[(d/j)-1]%mod)%mod;
            }
        }
        ans[1]++;
    }
    int cnt=0;
    for(int i=1;i<=n;i++)
        cnt=(cnt%mod+ans[i]%mod)%mod;
        cout<<cnt<<endl;

}


#include <bits/stdc++.h>
#include<math.h>
using namespace std;
#define int long long int
#define endl "\n"
#define PI 3.14159265
int MAXN = 5000001;
const int mod=1000000007;
const int INF =LONG_LONG_MAX;
inline int gcd(int a,int b){if(a==0) return b;return gcd(b%a,a);}
inline int pow(int a,int n,int mod){if(n==0)return 1;int p=pow(a,n/2,mod);p=(p%mod*p%mod)%mod;if(n%2) return (p%mod*a%mod)%mod;else return p;}
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)cin>>a[i];
    vector<int>ans(1000001,0);
    ans[0]=1;
    for(int i=0;i<n;i++)
    {
       vector<int>v;
        for(int j=1;j*j<=a[i];j++)
        {
            if((a[i]%j)==0)
            {
                v.push_back(j);
                if(j!=a[i]/j)v.push_back(a[i]/j);
            }
        }

        sort(v.rbegin(),v.rend());

       for(int k=0;k<v.size();k++)
        {
            //cout<<v[k]<<" ";
            ans[v[k]]+=ans[v[k]-1];
            ans[v[k]]%=mod;
        }
        //cout<<endl;
        //ans[1]++;
    }
    int cnt=0;
    for(int i=1;i<=n;i++)
        {
            cnt+=ans[i];cnt%=mod;
        }
        cout<<(cnt%mod)<<endl;

}


#include <bits/stdc++.h>
#include<math.h>
using namespace std;
#define int long long int
#define endl "\n"
#define PI 3.14159265
int MAXN = 5000001;
const int mod=1000000007;
const int INF =LONG_LONG_MAX;
inline int gcd(int a,int b){if(a==0) return b;return gcd(b%a,a);}
inline int pow(int a,int n,int mod){if(n==0)return 1;int p=pow(a,n/2,mod);p=(p%mod*p%mod)%mod;if(n%2) return (p%mod*a%mod)%mod;else return p;}
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)cin>>a[i];
    vector<int>ans(1000001,0);

    for(int i=0;i<n;i++)
    {
        int d=a[i];

        for(int j=sqrt(d);j>=1;j--)
        {
            if(d%j==0)
            {
                int d1=j;
                ans[d1]=(ans[d1]%mod+ans[d1-1]%mod)%mod;
                if(j!=(d/j))
                 ans[(d/j)]=(ans[(d/j)]%mod+ans[(d/j)-1]%mod)%mod;
            }
        }
        ans[1]++;
    }
    int cnt=0;
    for(int i=1;i<=n;i++)
        cnt=(cnt%mod+ans[i]%mod)%mod;
        cout<<cnt%mod<<endl;

}


#include <bits/stdc++.h>
#include<math.h>
using namespace std;
#define int long long int
#define endl "\n"
#define PI 3.14159265
int MAXN = 5000001;
const int mod=1000000009;
const int INF =LONG_LONG_MAX;
inline int gcd(int a,int b){if(a==0) return b;return gcd(b%a,a);}
inline int pow(int a,int n,int mod){if(n==0)return 1;int p=pow(a,n/2,mod);p=(p%mod*p%mod)%mod;if(n%2) return (p%mod*a%mod)%mod;else return p;}
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)cin>>a[i];
    vector<int>ans(100001,0);

    for(int i=0;i<n;i++)
    {
        int d=a[i];

        for(int j=1;j*j<=d;j++)
        {
            if(d%j==0)
            {
                int d1=j;
                ans[d1]+=ans[d1-1];
                if(j!=d/j&&(d/j)<=n)
                    ans[d/j]+=ans[(d/j)-1];
            }
        }
        ans[1]++;
    }
    int cnt=0;
    for(int i=1;i<=n;i++)
        cnt+=ans[i];
        cout<<cnt<<endl;

}


#include <bits/stdc++.h>
#include<math.h>
using namespace std;
#define int long long int
#define endl "\n"
#define PI 3.14159265
int MAXN = 5000001;
const int mod=1000000007;
const int INF =LONG_LONG_MAX;
inline int gcd(int a,int b){if(a==0) return b;return gcd(b%a,a);}
inline int pow(int a,int n,int mod){if(n==0)return 1;int p=pow(a,n/2,mod);p=(p%mod*p%mod)%mod;if(n%2) return (p%mod*a%mod)%mod;else return p;}
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)cin>>a[i];
    vector<int>ans(1000001,0);

    for(int i=0;i<n;i++)
    {
        int d=a[i];

        for(int j=sqrt(d);j>=1;j--)
        {
            if(d%j==0)
            {
                int d1=j;
                ans[d1]=((ans[d1]%mod)+(ans[d1-1]%mod))%mod;
                if(j!=(d/j))
                 ans[(d/j)]=((ans[(d/j)]%mod)+(ans[(d/j)-1]%mod))%mod;
            }
        }
        ans[1]++;
    }
    int cnt=0;
    for(int i=1;i<=n;i++)
        cnt=((cnt%mod)+(ans[i]%mod))%mod;
        cout<<(cnt%mod)<<endl;

}


/*/ Author: arl17 /*/
#include<bits/stdc++.h>
using namespace std;

/*/---------------------------Defines----------------------/*/

#define ll long long
#define F first
#define S second
#define pb push_back
#define endl "\n"
#define all(v) (v).begin(),(v).end()

typedef pair<ll,ll> pi;
/*/-----------------------Modular Arithmetic---------------/*/

const long long INF = 1ll << 32;
const int mod=1e9+7;
inline int add(int x,int y){
    x+=y;
    if (x>=mod) return x-mod;
    return x;
}
inline int sub(int x,int y){
    x-=y;
    if (x<0) return x+mod;
    return x;
}
inline int mul(int x,int y){
    return (x*1ll*y)%mod;
}
inline int power(int x,int y){
    int ans=1;
    while(y){
        if (y&1) ans=mul(ans,x);
        x=mul(x,x);
        y>>=1;
    }
    return ans;
}
inline int inv(int x){
    return power(x,mod-2);
}
/*/-----------------------------Code begins----------------------------------/*/
const int N=2e5+100;

void solve()
{
	ll i,j,k;
	ll n,m;
    cin>>n;
    ll a[n+1];
    for(i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    ll cnt[N];
    cnt[0]=1;
    for(i=1;i<=n;i++)
    {
        vector<ll> cur;
        for(j=1;j*j<=a[i];j++)
        {
            if(a[i]%j==0) cur.pb(j);
            if(a[i]/j!=j) cur.pb(a[i]/j);
        }
        sort(cur.begin(),cur.end());
        reverse(cur.begin(),cur.end());
        for(auto it:cur)
        {
            cnt[it]+=cnt[it-1];
            cnt[it]%=mod;
        }
    }
    ll ans=0;
    for(i=1;i<=n;i++)
    {
        ans+=cnt[i];
    }
    ans%=mod;
    cout<<ans<<endl;
}

int main()
{
	int t=1;
	//cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}


/*/ Author: arl17 /*/
#include<bits/stdc++.h>
using namespace std;

/*/---------------------------Defines----------------------/*/

#define ll long long
#define F first
#define S second
#define pb push_back
#define endl "\n"
#define all(v) (v).begin(),(v).end()

typedef pair<ll,ll> pi;
/*/-----------------------Modular Arithmetic---------------/*/

const long long INF = 1ll << 32;
const int mod=1e9+7;
inline int add(int x,int y){
    x+=y;
    if (x>=mod) return x-mod;
    return x;
}
inline int sub(int x,int y){
    x-=y;
    if (x<0) return x+mod;
    return x;
}
inline int mul(int x,int y){
    return (x*1ll*y)%mod;
}
inline int power(int x,int y){
    int ans=1;
    while(y){
        if (y&1) ans=mul(ans,x);
        x=mul(x,x);
        y>>=1;
    }
    return ans;
}
inline int inv(int x){
    return power(x,mod-2);
}
/*/-----------------------------Code begins----------------------------------/*/
const int N=2e5+100;

void solve()
{
	ll i,j,k;
	ll n,m;
    cin>>n;
    ll a[n+1];
    for(i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    ll cnt[N]={0};
    cnt[0]=1;
    for(i=1;i<=n;i++)
    {
        vector<ll> cur;
        for(j=1;j*j<=a[i];j++)
        {
            if(a[i]%j==0) cur.pb(j);
            if(a[i]/j!=j) cur.pb(a[i]/j);
        }
        sort(cur.begin(),cur.end());
        reverse(cur.begin(),cur.end());
        for(auto it:cur)
        {
            cnt[it]+=cnt[it-1];
            cnt[it]%=mod;
        }
    }
    ll ans=0;
    for(i=1;i<=n;i++)
    {
        ans+=cnt[i];
    }
    cout<<ans<<endl;
}

int main()
{
	int t=1;
	//cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}


/*/ Author: arl17 /*/
#include<bits/stdc++.h>
using namespace std;

/*/---------------------------Defines----------------------/*/

#define ll long long
#define F first
#define S second
#define pb push_back
#define endl "\n"
#define all(v) (v).begin(),(v).end()

typedef pair<ll,ll> pi;
/*/-----------------------Modular Arithmetic---------------/*/

const long long INF = 1ll << 32;
const int mod=1e9+7;
inline int add(int x,int y){
    x+=y;
    if (x>=mod) return x-mod;
    return x;
}
inline int sub(int x,int y){
    x-=y;
    if (x<0) return x+mod;
    return x;
}
inline int mul(int x,int y){
    return (x*1ll*y)%mod;
}
inline int power(int x,int y){
    int ans=1;
    while(y){
        if (y&1) ans=mul(ans,x);
        x=mul(x,x);
        y>>=1;
    }
    return ans;
}
inline int inv(int x){
    return power(x,mod-2);
}
/*/-----------------------------Code begins----------------------------------/*/
const int N=2e5+100;

void solve()
{
	ll i,j,k;
	ll n,m;
    cin>>n;
    ll a[n+1];
    for(i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    ll cnt[1e6+5];
    cnt[0]=1;
    for(i=1;i<=n;i++)
    {
        vector<ll> cur;
        for(j=1;j*j<=a[i];j++)
        {
            if(a[i]%j==0) cur.pb(j);
            if(a[i]%j==0 && a[i]/j!=j) cur.pb(a[i]/j);
        }
        sort(cur.begin(),cur.end());
        reverse(cur.begin(),cur.end());
        for(auto it:cur)
        {
            cnt[it]+=cnt[it-1];
            cnt[it]%=mod;
        }
    }
    ll ans=0;
    for(i=1;i<=n;i++)
    {
        ans+=cnt[i];
    }
    ans%=mod;
    cout<<ans<<endl;
}

int main()
{
	int t=1;
	//cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}


/*/ Author: arl17 /*/
#include<bits/stdc++.h>
using namespace std;

/*/---------------------------Defines----------------------/*/

#define ll long long
#define F first
#define S second
#define pb push_back
#define endl "\n"
#define all(v) (v).begin(),(v).end()

typedef pair<ll,ll> pi;
/*/-----------------------Modular Arithmetic---------------/*/

const long long INF = 1ll << 32;
const int mod=1e9+7;
inline int add(int x,int y){
    x+=y;
    if (x>=mod) return x-mod;
    return x;
}
inline int sub(int x,int y){
    x-=y;
    if (x<0) return x+mod;
    return x;
}
inline int mul(int x,int y){
    return (x*1ll*y)%mod;
}
inline int power(int x,int y){
    int ans=1;
    while(y){
        if (y&1) ans=mul(ans,x);
        x=mul(x,x);
        y>>=1;
    }
    return ans;
}
inline int inv(int x){
    return power(x,mod-2);
}
/*/-----------------------------Code begins----------------------------------/*/
const int N=2e5+100;

void solve()
{
	ll i,j,k;
	ll n,m;
    cin>>n;
    ll a[n+1];
    for(i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    ll cnt[N]={0};
    cnt[0]=1;
    for(i=1;i<=n;i++)
    {
        vector<ll> cur;
        for(j=1;j*j<=a[i];j++)
        {
            if(a[i]%j==0) cur.pb(j);
            if(a[i]/j!=j) cur.pb(a[i]/j);
        }
        sort(cur.begin(),cur.end());
        reverse(cur.begin(),cur.end());
        for(auto it:cur)
        {
            cnt[it]+=cnt[it-1];
            cnt[it]%=mod;
        }
    }
    ll ans=0;
    for(i=1;i<=n;i++)
    {
        ans+=cnt[i];
    }
    ans%=mod;
    cout<<ans<<endl;
}

int main()
{
	int t=1;
	//cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}


/*/ Author: arl17 /*/
#include<bits/stdc++.h>
using namespace std;

/*/---------------------------Defines----------------------/*/

#define ll long long
#define F first
#define S second
#define pb push_back
#define endl "\n"
#define all(v) (v).begin(),(v).end()

typedef pair<ll,ll> pi;
/*/-----------------------Modular Arithmetic---------------/*/

const long long INF = 1ll << 32;
const int mod=1e9+7;
inline int add(int x,int y){
    x+=y;
    if (x>=mod) return x-mod;
    return x;
}
inline int sub(int x,int y){
    x-=y;
    if (x<0) return x+mod;
    return x;
}
inline int mul(int x,int y){
    return (x*1ll*y)%mod;
}
inline int power(int x,int y){
    int ans=1;
    while(y){
        if (y&1) ans=mul(ans,x);
        x=mul(x,x);
        y>>=1;
    }
    return ans;
}
inline int inv(int x){
    return power(x,mod-2);
}
/*/-----------------------------Code begins----------------------------------/*/
const int N=2e5+100;

void solve()
{
	ll i,j,k;
	ll n,m;
    cin>>n;
    ll a[n+1];
    for(i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    ll dp[n+1][n+1];
    for(i=0;i<=n;i++)
    {
        dp[0][i]=0;
    }
    for(i=1;i<=n;i++)
    {
        dp[i][0]=0;
        dp[i][1]=i;
        for(j=2;j<=n;j++)
        {
            if(a[i]%j==0) dp[i][j]=dp[i-1][j-1]+dp[i-1][j];
            else dp[i][j]=dp[i-1][j];
        }
    }

    ll sum=0;
    for(i=1;i<=n;i++)
    {
        sum+=dp[n][i];
    }
    cout<<sum<<endl;
}

int main()
{
	int t=1;
	//cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}


/*/ Author: arl17 /*/
#include<bits/stdc++.h>
using namespace std;

/*/---------------------------Defines----------------------/*/

#define ll long long
#define F first
#define S second
#define pb push_back
#define endl "\n"
#define all(v) (v).begin(),(v).end()

typedef pair<ll,ll> pi;
/*/-----------------------Modular Arithmetic---------------/*/

const long long INF = 1ll << 32;
const int mod=1e9+7;
inline int add(int x,int y){
    x+=y;
    if (x>=mod) return x-mod;
    return x;
}
inline int sub(int x,int y){
    x-=y;
    if (x<0) return x+mod;
    return x;
}
inline int mul(int x,int y){
    return (x*1ll*y)%mod;
}
inline int power(int x,int y){
    int ans=1;
    while(y){
        if (y&1) ans=mul(ans,x);
        x=mul(x,x);
        y>>=1;
    }
    return ans;
}
inline int inv(int x){
    return power(x,mod-2);
}
/*/-----------------------------Code begins----------------------------------/*/
const int N=2e5+100;

void solve()
{
	ll i,j,k;
	ll n,m;
    cin>>n;
    ll a[n+1];
    for(i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    ll cnt[1e6+5];
    cnt[0]=1;
    for(i=1;i<=n;i++)
    {
        vector<ll> cur;
        for(j=1;j*j<=a[i];j++)
        {
            if(a[i]%j==0) cur.pb(j);
            if(a[i]/j!=j) cur.pb(a[i]/j);
        }
        sort(cur.begin(),cur.end());
        reverse(cur.begin(),cur.end());
        for(auto it:cur)
        {
            cnt[it]+=cnt[it-1];
            cnt[it]%=mod;
        }
    }
    ll ans=0;
    for(i=1;i<=n;i++)
    {
        ans+=cnt[i];
    }
    ans%=mod;
    cout<<ans<<endl;
}

int main()
{
	int t=1;
	//cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}


/*/ Author: arl17 /*/
#include<bits/stdc++.h>
using namespace std;

/*/---------------------------Defines----------------------/*/

#define ll long long
#define F first
#define S second
#define pb push_back
#define endl "\n"
#define all(v) (v).begin(),(v).end()

typedef pair<ll,ll> pi;
/*/-----------------------Modular Arithmetic---------------/*/

const long long INF = 1ll << 32;
const int mod=1e9+7;
inline int add(int x,int y){
    x+=y;
    if (x>=mod) return x-mod;
    return x;
}
inline int sub(int x,int y){
    x-=y;
    if (x<0) return x+mod;
    return x;
}
inline int mul(int x,int y){
    return (x*1ll*y)%mod;
}
inline int power(int x,int y){
    int ans=1;
    while(y){
        if (y&1) ans=mul(ans,x);
        x=mul(x,x);
        y>>=1;
    }
    return ans;
}
inline int inv(int x){
    return power(x,mod-2);
}
/*/-----------------------------Code begins----------------------------------/*/
const int N=2e5+100;

void solve()
{
	ll i,j,k;
	ll n,m;
    cin>>n;
    ll a[n+1];
    for(i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    ll cnt[1000006];
    cnt[0]=1;
    for(i=1;i<=n;i++)
    {
        vector<ll> cur;
        for(j=1;j*j<=a[i];j++)
        {
            if(a[i]%j==0) cur.pb(j);
            if(a[i]/j!=j) cur.pb(a[i]/j);
        }
        sort(cur.begin(),cur.end());
        reverse(cur.begin(),cur.end());
        for(auto it:cur)
        {
            cnt[it]+=cnt[it-1];
            cnt[it]%=mod;
        }
    }
    ll ans=0;
    for(i=1;i<=n;i++)
    {
        ans+=cnt[i];
    }
    ans%=mod;
    cout<<ans<<endl;
}

int main()
{
	int t=1;
	//cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}


/*/ Author: arl17 /*/
#include<bits/stdc++.h>
using namespace std;

/*/---------------------------Defines----------------------/*/

#define ll long long
#define F first
#define S second
#define pb push_back
#define endl "\n"
#define all(v) (v).begin(),(v).end()

typedef pair<ll,ll> pi;
/*/-----------------------Modular Arithmetic---------------/*/

const long long INF = 1ll << 32;
const int mod=1e9+7;
inline int add(int x,int y){
    x+=y;
    if (x>=mod) return x-mod;
    return x;
}
inline int sub(int x,int y){
    x-=y;
    if (x<0) return x+mod;
    return x;
}
inline int mul(int x,int y){
    return (x*1ll*y)%mod;
}
inline int power(int x,int y){
    int ans=1;
    while(y){
        if (y&1) ans=mul(ans,x);
        x=mul(x,x);
        y>>=1;
    }
    return ans;
}
inline int inv(int x){
    return power(x,mod-2);
}
/*/-----------------------------Code begins----------------------------------/*/
const int N=2e5+100;

void solve()
{
	ll i,j,k;
	ll n,m;
    cin>>n;
    ll a[n+1];
    for(i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    ll cnt[1000006];
    cnt[0]=1;
    for(i=1;i<=n;i++)
    {
        vector<ll> cur;
        for(j=1;j*j<=a[i];j++)
        {
            if(a[i]%j==0) cur.pb(j);
            if(a[i]%j==0 && a[i]/j!=j) cur.pb(a[i]/j);
        }
        sort(cur.begin(),cur.end());
        reverse(cur.begin(),cur.end());
        for(auto it:cur)
        {
            cnt[it]+=cnt[it-1];
            cnt[it]%=mod;
        }
    }
    ll ans=0;
    for(i=1;i<=n;i++)
    {
        ans+=cnt[i];
    }
    ans%=mod;
    cout<<ans<<endl;
}

int main()
{
	int t=1;
	//cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long

bool sortbysec(const pair<int,int> &a,const pair<int,int> &b)
{
    return (a.second < b.second);
}

int main()
{
    IOS;
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    int dp[n+1]={0};
    dp[1]=1;
    for(int i=1;i<n;i++){
        int x=sqrt(a[i])+1;
        for(int j=2;j<=x;j++){
            if(a[i]%j==0){
                dp[j]+=dp[j-1];
            }
        }
        dp[1]++;
    }
    ll ans=0;
    for(int i=1;i<=n;i++){
        ans+=dp[i];
    }
    cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long

bool sortbysec(const pair<int,int> &a,const pair<int,int> &b)
{
    return (a.second < b.second);
}

ll mod=1000000007;

int main()
{
    IOS;
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    ll dp[n+1][2]={{0}};
    dp[1][0]=1;
    for(int i=1;i<n;i++){
        int x=sqrt(a[i])+1;
        for(int j=2;j<=min(x,i+1);j++){
            if(a[i]%j==0){
                dp[j][1]=((dp[j][0]%mod)+(dp[j-1][0]%mod))%mod;
            }
        }
        for(int j=2;j<=min(x,i+1);j++){
            if(a[i]%j==0)
                dp[j][0]=dp[j][1]%mod;
        }
        dp[1][0]=(dp[1][0]+1)%mod;
    }
    ll ans=0;
    for(int i=1;i<=n;i++){
        ans=(ans+dp[i][0])%mod;
    }
    cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long

bool sortbysec(const pair<int,int> &a,const pair<int,int> &b)
{
    return (a.second < b.second);
}

int main()
{
    IOS;
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    int dp[n+1]={0};
    for(int i=0;i<n;i++){
        for(int j=2;j<=sqrt(a[i])+1;j++){
            if(a[i]%j==0){
                dp[j]+=dp[j-1];
            }
        }
        dp[1]++;
    }
    ll ans=0;
    for(int i=1;i<=n;i++){
        ans+=dp[i];
    }
    cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long

bool sortbysec(const pair<int,int> &a,const pair<int,int> &b)
{
    return (a.second < b.second);
}

int main()
{
    IOS;
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    int dp[n+1]={0};
    dp[1]=1;
    for(int i=1;i<n;i++){
        int x=sqrt(a[i])+1;
        for(int j=2;j<=min(x,i+1);j++){
            if(a[i]%j==0){
                dp[j]=dp[j]+dp[j-1];
            }
        }
        dp[1]++;
    }
    ll ans=0;
    for(int i=1;i<=n;i++){
        ans+=dp[i];
    }
    cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long

bool sortbysec(const pair<int,int> &a,const pair<int,int> &b)
{
    return (a.second < b.second);
}

int main()
{
    IOS;
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    int dp[n+1][2]={{0}};
    dp[1][1]=1;
    dp[1][0]=1;
    for(int i=1;i<n;i++){
        int x=sqrt(a[i])+1;
        for(int j=2;j<=min(x,i+1);j++){
            if(a[i]%j==0){
                dp[j][1]=dp[j][0]+dp[j-1][0];
            }
        }
        for(int j=2;j<=min(x,i+1);j++){
            dp[j][0]=dp[j][1];
        }
        dp[1][1]++;
        dp[1][0]++;
    }
    ll ans=0;
    for(int i=1;i<=n;i++){
        //cout<<dp[i]<<endl;
        ans+=dp[i][0];
    }
    cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long

bool sortbysec(const pair<int,int> &a,const pair<int,int> &b)
{
    return (a.second < b.second);
}

ll mod=1000000007;

int main()
{
    IOS;
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    ll dp[n+1][2]={{0}};
    dp[1][1]=1;
    dp[1][0]=1;
    for(int i=1;i<n;i++){
        int x=sqrt(a[i])+1;
        for(int j=2;j<=min(x,i+1);j++){
            if(a[i]%j==0){
                dp[j][1]=((dp[j][0]%mod)+(dp[j-1][0]%mod))%mod;
            }
        }
        for(int j=2;j<=min(x,i+1);j++){
            dp[j][0]=dp[j][1]%mod;
        }
        dp[1][1]=(dp[1][1]+1)%mod;
        dp[1][0]=(dp[1][0]+1)%mod;
    }
    ll ans=0;
    for(int i=1;i<=n;i++){
        //cout<<dp[i]<<endl;
        ans=(ans+dp[i][0])%mod;
    }
    cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long

bool sortbysec(const pair<int,int> &a,const pair<int,int> &b)
{
    return (a.second < b.second);
}

ll mod=1000000007;

int main()
{
    IOS;
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    ll dp[n+1][2]={{0}};
    dp[1][1]=1;
    dp[1][0]=1;
    for(int i=1;i<n;i++){
        int x=sqrt(a[i])+1;
        for(int j=2;j<=min(x,i+1);j++){
            if(a[i]%j==0){
                dp[j][1]=(dp[j][0]+dp[j-1][0])%mod;
            }
        }
        for(int j=2;j<=min(x,i+1);j++){
            dp[j][0]=dp[j][1]%mod;
        }
        dp[1][1]++;
        dp[1][0]++;
    }
    ll ans=0;
    for(int i=1;i<=n;i++){
        //cout<<dp[i]<<endl;
        ans=(ans+dp[i][0])%mod;
    }
    cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long

bool sortbysec(const pair<int,int> &a,const pair<int,int> &b)
{
    return (a.second < b.second);
}

int main()
{
    IOS;
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    int dp[n+1]={0};
    for(int i=0;i<n;i++){
        int x=sqrt(a[i])+1;
        for(int j=2;j<=x;j++){
            if(a[i]%j==0){
                dp[j]+=dp[j-1];
            }
        }
        dp[1]++;
    }
    ll ans=0;
    for(int i=1;i<=n;i++){
        ans+=dp[i];
    }
    cout<<ans;
}