using System;

namespace Multiplicity_1061C
{
    class Program
    {
        static void Main(string[] args)
        {

            //System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            //sw.Start();
            int size = Convert.ToInt32(Console.ReadLine());
            int[] inputArr = new int[size];

            string input = Console.ReadLine();

            string[] nums = input.Split(' ');

            for (int i = 0; i < size; i++)
            {
                inputArr[i] = Convert.ToInt32(nums[i]);
            }

            long answer = 0;

            int[] divCnt = new int[1000001];
            for (int i = 1000000; i >= 1; --i)
            {
                for (int j = i; j <= 1000000; j += i)
                    divCnt[j]++;
            }

            int[][] divisorsArr = new int[1000001][];
            for (int i = 0; i < 1000001; i++)
            {
                divisorsArr[i] = new int[divCnt[i]];
            }

            int[] pointer = new int[1000001];
            for (int n = 0; n < 1000001; n++)
            {
                pointer[n] = 0;
            }
            for (int i = 1000000; i >= 1; --i)
            {
                for (int j = i; j < 1000001; j += i)
                {
                    divisorsArr[j][pointer[j]++] = i;
                }
            }

            long module = 1000000007;
            long[] ansArr = new long[1000001];
            ansArr[0] = 1;

            for (int i = 0; i < size; i++)
            {
                foreach (var n in divisorsArr[inputArr[i]])
                {

                    ansArr[n] = (ansArr[n] + ansArr[n - 1]) % module;
                }
            }

            for (int i = 0; i < 1000001; i++)
            {
                answer += ansArr[i];
            }

            //sw.Stop();
           // Console.Write("Время: " + sw.ElapsedMilliseconds / 1000.00 + "\n");
            Console.Write(answer - 1);
        }

    }
}


using System;
using System.IO;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;

class Program
{
    class T
    {
        public long X;
        public long Y;

        public T(long x, long y)
        {
            X = x;
            Y = y;
        }
    }
    //////////////////////////////////////////////////

    List<int> Get(int a, int n)
    {
        var res = new List<int>();
        for (int i = 1; i * i <= a && i <= n; i++)
        {
            var p = a / i;
            var q = a % i;
            if (q == 0)
            {
                res.Add(i);
                if (p <= n && i != p)
                    res.Add(p);
            }
        }
        res.Sort((x, y) => y.CompareTo(x));
        return res;
    }

    int mod = 1000000000 + 7;
    //////////////////////////////////////////////////
    void Solution()
    {
        var n = ri;
        var a = ria(n);
        int z = 0;
        var dp = new long[n + 1];
        dp[0] = 1;
        for (int i = 0; i < n; i++)
        {
            var q = Get(a[i], z + 1);
            foreach(var o in q)
            {
                dp[o] = (dp[o] + dp[o - 1]) % mod;
                if (o > z)
                    z = o;
            }
        }
        long res = 0;
        foreach (var o in dp)
            res = (res + o) % mod;
        wln(res-1);
    }
    //////////////////////////////////////////////////

    struct P : IComparable<P>
    {
        public long X;
        public long Y;

        public P(long x, long y)
        {
            X = x;
            Y = y;
        }

        public int CompareTo(P other) => X != other.X ? X.CompareTo(other.X) : Y.CompareTo(other.Y);
        public static int Comparison(P p1, P p2) => p1.CompareTo(p2);

        public static bool operator ==(P p1, P p2) => (p1.X == p2.X) && (p1.Y == p2.Y);
        public static bool operator !=(P p1, P p2) => (p1.X != p2.X) || (p1.Y != p2.Y);

        public static P operator +(P p1, P p2) => new P(p1.X + p2.X, p1.Y + p2.Y);
        public static P operator -(P p1, P p2) => new P(p1.X - p2.X, p1.Y - p2.Y);
    }

    void swap<T>(ref T o1, ref T o2) { var o = o1; o1 = o2; o2 = o; }
    long gcd(long a, long b) => (b != 0) ? gcd(b, a % b) : a;
    long lcm(long a, long b) => a / gcd(a, b) * b;

    long rast2(long x1, long y1, long x2, long y2) => (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
    long rast2(P p1, P p2) => (p1.X - p2.X) * (p1.X - p2.X) + (p1.Y - p2.Y) * (p1.Y - p2.Y);
    long ccw(P p1, P p2, P p3) => p1.X * p2.Y + p1.Y * p3.X + p2.X * p3.Y - p2.Y * p3.X - p3.Y * p1.X - p1.Y * p2.X;

    StringBuilder _sb = new StringBuilder();
    void wln() { _sb.AppendLine(); }
    void wln<T>(T o) { _sb.AppendLine(o.ToString()); }
    void wsp<T>(T o) { _sb.Append(o).Append(" "); }
    void wrt<T>(T o) { _sb.Append(o); }
    void wln(double o) { _sb.AppendLine(string.Format(CultureInfo.InvariantCulture, "{0:F12}", o)); }
    void wsp(double o) { _sb.Append(string.Format(CultureInfo.InvariantCulture, "{0:F12} ", o)); }
    void wrt(double o) { _sb.Append(string.Format(CultureInfo.InvariantCulture, "{0:F12}", o)); }

    List<P> rpa(int n)
    {
        var res = new List<P>(n);
        for (int i = 0; i < n; i++)
            res.Add(new P(rl, rl));
        return res;
    }

    int ri
    {
        get
        {
            _read(); while (_str[_ind] == ' ') ++_ind;
            int sign = 1; if (_str[_ind] == '-') { sign = -1; ++_ind; }
            int p = 0;
            while (_ind < _count && _str[_ind] != ' ') p = p * 10 + _str[_ind++] - '0';
            while (_ind < _count && _str[_ind] == ' ') ++_ind; return p * sign;
        }
    }
    long rl
    {
        get
        {
            _read(); while (_str[_ind] == ' ') ++_ind;
            int sign = 1; if (_str[_ind] == '-') { sign = -1; ++_ind; }
            long p = 0;
            while (_ind < _count && _str[_ind] != ' ') p = p * 10 + _str[_ind++] - '0';
            while (_ind < _count && _str[_ind] == ' ') ++_ind; return p * sign;
        }
    }
    double rd
    {
        get
        {
            _read(); while (_str[_ind] == ' ') ++_ind; int sign = 1; if (_str[_ind] == '-') { sign = -1; ++_ind; }
            long p = 0, q = 1; while (_ind < _count && _str[_ind] != ' ' && _str[_ind] != '.') p = p * 10 + _str[_ind++] - '0';
            if (_ind < _count && _str[_ind] == '.') { ++_ind; while (_ind < _count && _str[_ind] != ' ') { p = p * 10 + _str[_ind++] - '0'; q *= 10; } }
            while (_ind < _count && _str[_ind] == ' ') ++_ind; return (double)p / q * sign;
        }
    }
    string rs
    {
        get
        {
            _read(); while (_ind < _count && _str[_ind] == ' ') ++_ind;
            var tmp = _str.IndexOf(' ', _ind);
            if (tmp == -1) { var res = _str.Substring(_ind); _count = 0; _ind = 0; return res; }
            var s = _str.Substring(_ind, tmp - _ind); _ind = tmp + 1;
            while (_ind < _count && _str[_ind] == ' ') ++_ind; return s;
        }
    }

    List<int> ria(int n)
    {
        var res = new int[n];
        for (int k = 0; k < n;)
        {
            var s = Console.ReadLine(); var m = s.Length;
            for (int i = 0; i < m && k < n; ++i)
            {
                while (i < m && s[i] == ' ') ++i; if (i == m) break; int sign = 1; if (s[i] == '-') { sign = -1; ++i; }
                int p = 0; while (i < m && s[i] != ' ') p = p * 10 + s[i++] - '0'; res[k++] = p * sign;
            }
        }
        _count = 0; _ind = 0; return res.ToList();
    }
    List<long> rla(int n)
    {
        var res = new long[n];
        for (int k = 0; k < n;)
        {
            var s = Console.ReadLine(); var m = s.Length;
            for (int i = 0; i < m && k < n; ++i)
            {
                while (i < m && s[i] == ' ') ++i; if (i == m) break; int sign = 1; if (s[i] == '-') { sign = -1; ++i; }
                long p = 0; while (i < m && s[i] != ' ') p = p * 10 + s[i++] - '0'; res[k++] = p * sign;
            }
        }
        _count = 0; _ind = 0; return res.ToList();
    }
    List<double> rda(int n)
    {
        var res = new double[n];
        for (int k = 0; k < n;)
        {
            var s = Console.ReadLine(); var m = s.Length;
            for (int i = 0; i < m && k < n; ++i)
            {
                while (i < m && s[i] == ' ') ++i; if (i == m) break; int sign = 1; if (s[i] == '-') { sign = -1; ++i; }
                long p = 0, q = 1; while (i < m && s[i] != ' ' && s[i] != '.') p = p * 10 + s[i++] - '0';
                if (i < m && s[i] == '.') { ++i; while (i < m && s[i] != ' ') { p = p * 10 + s[i++] - '0'; q *= 10; } }
                res[k++] = (double)p / q * sign;
            }
        }
        _count = 0; _ind = 0; return res.ToList();
    }
    List<string> rsa(int n) { var res = new string[n]; for (int k = 0; k < n; ++k) res[k] = Console.ReadLine(); _count = 0; _ind = 0; return res.ToList(); }
    string _str = null; int _count = 0; int _ind = 0;
    void _read() { if (_ind == _count) { _str = Console.ReadLine(); _count = _str.Length; _ind = 0; } }
    static void Main(string[] args) { new Program().Main(); }
    void Main()
    {
        //Console.SetIn(new StreamReader("input.txt")); Console.SetOut(new StreamWriter("output.txt"));
        Solution();
        Console.Write(_sb);
        //Console.In.Close(); Console.Out.Close();
    }
}


macro_rules! input {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    let stdin = std::io::stdin();
    let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
    let mut next = move || -> String{
        bytes
            .by_ref()
            .map(|r|r.unwrap() as char)
            .skip_while(|c|c.is_whitespace())
            .take_while(|c|!c.is_whitespace())
            .collect()
    };
    input! {next,
        n: usize,
        a: [usize; n],
    }
    let mut a = a;
    a.insert(0, 0);
    let mut list = vec![0; n+1];
    list[0] = 1;
    for m in 1..=n {
        let mut divisors = Vec::new();
        for i in 1..=(m as f64).sqrt() as usize {
            if a[m] % i == 0 {
                divisors.push(i);
                if i * i != a[m] {
                    divisors.push(a[m]/i);
                }
            }
        }
        divisors.sort();
        for d in divisors.into_iter().rev().filter(|&x| x <= m) {
            list[d] += list[d-1];
        }
    }
    list[0] = 0;
    println!("{}", list.iter().sum::<usize>());
}


macro_rules! input {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    let stdin = std::io::stdin();
    let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
    let mut next = move || -> String{
        bytes
            .by_ref()
            .map(|r|r.unwrap() as char)
            .skip_while(|c|c.is_whitespace())
            .take_while(|c|!c.is_whitespace())
            .collect()
    };
    input! {next,
        n: usize,
        a: [usize; n],
    }
    let mut a = a;
    a.insert(0, 0);
    let mut list = vec![0; n+1];
    list[0] = 1;
    for m in 1..=n {
        let mut divisors = Vec::new();
        for i in 1..=(a[m] as f64).sqrt() as usize {
            if a[m] % i == 0 {
                divisors.push(i);
                if i * i != a[m] {
                    divisors.push(a[m]/i);
                }
            }
        }
        divisors.sort();
        // dbg!(&divisors);
        for d in divisors.into_iter().rev().filter(|&x| x <= m) {
            list[d] = (list[d-1] + list[d]) % 1000000007;
        }
    }
    // dbg!(&list);
    list[0] = 0;
    println!("{}", list.iter().fold(0, |acc, x| (acc + x) % 1000000007) );
}


macro_rules! input {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    let stdin = std::io::stdin();
    let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
    let mut next = move || -> String{
        bytes
            .by_ref()
            .map(|r|r.unwrap() as char)
            .skip_while(|c|c.is_whitespace())
            .take_while(|c|!c.is_whitespace())
            .collect()
    };
    input! {next,
        n: usize,
        a: [usize; n],
    }
    let mut a = a;
    a.insert(0, 0);
    let mut list = vec![0; n+1];
    list[0] = 1;
    for m in 1..=n {
        let mut divisors = Vec::new();
        for i in 1..=(a[m] as f64).sqrt() as usize {
            if a[m] % i == 0 {
                divisors.push(i);
                if i * i != a[m] {
                    divisors.push(a[m]/i);
                }
            }
        }
        divisors.sort();
        // dbg!(&divisors);
        for d in divisors.into_iter().rev().filter(|&x| x <= m) {
            list[d] += list[d-1];
        }
    }
    // dbg!(&list);
    list[0] = 0;
    println!("{}", list.iter().sum::<usize>());
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

var in = bufio.NewReaderSize(os.Stdin, 2<<16)

const (
	mod  = 1e9 + 7
	maxA = 1e6
)

var divs = make([]int, 100)

var primes = []int{2}

func init() {
	for i := 3; i*i <= maxA; i += 2 {
		found := false
		for _, p := range primes {
			if i%p == 0 {
				found = true
				break
			}
		}
		if !found {
			primes = append(primes, i)
		}
	}
}

func divisors(x int) []int {
	divs = divs[:1]
	divs[0] = x
	for _, p := range primes {
		if x < p {
			break
		}
		num := 0
		for x%p == 0 {
			num++
			x /= p
		}
		if num > 0 {
			for _, d := range divs {
				pp := p
				for i := 0; i < num; i++ {
					divs = append(divs, d/pp)
					pp *= p
				}
			}
		}
	}
	if x != 1 {
		for _, d := range divs {
			divs = append(divs, d/x)
		}
	}
	return divs
}

func main() {
	var n int
	fmt.Fscan(in, &n)
	a := make([]int, n)
	for i := range a {
		fmt.Fscan(in, &a[i])
	}
	num := make([]int, n+1)
	num[0] = 1
	for _, a := range a {
		for _, div := range divisors(a) {
			if div <= n {
				num[div] = (num[div] + num[div-1]) % mod
			}
		}
	}

	ans := 0
	for _, num := range num[1:] {
		ans = (ans + num) % mod
	}
	fmt.Println(ans)
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

var in = bufio.NewReaderSize(os.Stdin, 2<<16)

const (
	mod  = 1e9 + 7
	maxA = 1e6
)

var divs = make([]int, 100)

var primes = []int{2}

func init() {
	for i := 3; i*i <= maxA; i += 2 {
		found := false
		for _, p := range primes {
			if i%p == 0 {
				found = true
				break
			}
		}
		if !found {
			primes = append(primes, i)
		}
	}
}

func divisors(x int) []int {
	divs = divs[:1]
	divs[0] = x
	for _, p := range primes {
		if x < p {
			break
		}
		num := 0
		for x%p == 0 {
			num++
			x /= p
		}
		if num > 0 {
			for _, d := range divs {
				pp := p
				for i := 0; i < num; i++ {
					divs = append(divs, d/pp)
					pp *= p
				}
			}
		}
	}
	if x != 1 {
		for _, d := range divs {
			divs = append(divs, d/x)
		}
	}
	sort.Ints(divs)
	return divs
}

func main() {
	var n int
	fmt.Fscan(in, &n)
	a := make([]int, n)
	for i := range a {
		fmt.Fscan(in, &a[i])
	}
	num := make([]int, n+1)
	num[0] = 1
	for _, a := range a {
		divs := divisors(a)
		for i := len(divs) - 1; i >= 0; i-- {
			div := divs[i]
			if div <= n {
				num[div] = (num[div] + num[div-1]) % mod
			}
		}
	}

	ans := 0
	for _, num := range num[1:] {
		ans = (ans + num) % mod
	}
	fmt.Println(ans)
}


package main

import (
	"bufio"
	"fmt"
	"os"
)

var in = bufio.NewReaderSize(os.Stdin, 2<<16)

const (
	mod  = 1e9 + 7
	maxA = 1e6
)

var divs = make([]int, 100)

var primes = []int{2}

func init() {
	for i := 3; i*i <= maxA; i += 2 {
		found := false
		for _, p := range primes {
			if i%p == 0 {
				found = true
				break
			}
		}
		if !found {
			primes = append(primes, i)
		}
	}
}

func divisors(x int) []int {
	divs = divs[:1]
	divs[0] = x
	for _, p := range primes {
		if x < p {
			break
		}
		num := 0
		for x%p == 0 {
			num++
			x /= p
		}
		if num > 0 {
			for _, d := range divs {
				pp := p
				for i := 0; i < num; i++ {
					divs = append(divs, d/pp)
					pp *= p
				}
			}
		}
	}
	if x != 1 {
		for _, d := range divs {
			divs = append(divs, d/x)
		}
	}
	return divs
}

func main() {
	var n int
	fmt.Fscan(in, &n)
	a := make([]int, n)
	for i := range a {
		fmt.Fscan(in, &a[i])
	}
	num := make([]int, n+1)
	num[0] = 1
	for _, a := range a {
		for _, div := range divisors(a) {
			if div <= n {
				num[div] += num[div-1]
			}
		}
	}

	ans := 0
	for _, num := range num[1:] {
		ans = (ans + num) % mod
	}
	fmt.Println(ans)
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

func Prim(n int)[]int{
	p := make([]int,0)
	flag := make([]bool,n+1)
	for i:=2;i*i <= n;i++{
		if flag[i] == false{
			for j:= 2 ;i*j <= n ;j++{
				flag[i*j] = true
			}
		}
	}
	for i := 2;i <= n;i++{
		if flag[i] == false{
			p = append(p,i)
		}
	}
	return p
}
func Div(n int,max int,p []int)[]int{
	if max > n{
		max = n
	}
	res := make([]int,0)
	res = append(res,1)
	if n>1 && n <= max{
		res = append(res,n)
	}
	var lent = len(p)
	var nn int= n
//	fmt.Printf("n=%d lent=%d\n",n,lent)
	for i:= 0;i < lent&&p[i] <= n;i++{
		if n%p[i] != 0{
			continue
		}
//		fmt.Printf("===get div %d\n",p[i])
		var tl int = len(res)
		newres := make([]int,0)
		for m :=p[i];n%p[i] == 0; n/=p[i]{
			for j := 0;j < tl;j++{
				if res[j]*m <=max &&res[j]*m < nn {
					if res[j]*m <= 0{
						fmt.Print("res=",res[j]," m=",m,"\n")
					}
					newres = append(newres, res[j]*m)
				}
			}
			m *=p[i]
		}
		res = append(res,newres...)
		//fmt.Printf("res=%v",res)
	}
	sort.Ints(res)
	return res
}
func Solve(n int,mat []int)  {
	var mod int64=1000000007
	var max int = 0
	for i := 0;i < n;i++{
		if mat[i] > max{
			max = mat[i]
		}
	}
	if max > n{
		max = n
	}
	p := Prim(max)
	//	fmt.Print("p=",p,"\n")
	var sum int64=0
	dp := make([]int64,max+1)
	dp[0] = int64(1)
	for i := 0;i < n;i++{
		d := Div(mat[i],max,p)
	//		fmt.Print(d)
		//	fmt.Printf("\n")
		for j:= len(d)-1;j >= 0;j--{
			if d[j] <= 0||d[j] > max{
				fmt.Print("ERROR, unexpect d!!!! mat=",mat[i]," ,d=",d)
				return
			}
			dp[d[j]] =(dp[d[j]]+ dp[d[j]-1])%mod
			sum  = (sum+dp[d[j]-1])%mod
			//		fmt.Print("dp=",dp[d[j]-1],",sum=",sum,"\n")
		}
	}
	fmt.Print(sum)
}
func main(){

	buf := bufio.NewReader(os.Stdin)
	var n int
	fmt.Fscanf(buf, "%d\n", &n)
	mat := make([]int,n)
	for i := 0;i < n;i++{
		fmt.Fscanf(buf,"%d",&mat[i])
	}
	Solve(n,mat)
	//HackC()
}

func HackC()  {
	var n int = 72
	var mat []int = []int{383353,171666,386523,224379,150402,72524,81041,782234,486385,797836,794110,339698,774209,495068,912228,964393,944290,204638,73597,629048,113397,889283,312566,901932,599889,926485,583023,6632,766273,314862,166844,938593,689924,614015,818471,118112,51020,638346,801899,719300,916735,561257,173626,954749,626873,368197,965305,345106,803464,669983,863487,949532,572463,733386,375129,792457,67427,747310,5449,440026,974097,691335,254210,71525,654102,737445,791470,559123,649285,504554,115752,644067,101349}
	//var n int = 1
	//var mat []int = []int{964393}

	//	Solve(n,mat)
	var max int = 0
	for i := 0;i < n;i++{
		if mat[i] > max{
			max = mat[i]
		}
	}
	if max > n{
		max = n
	}
	p := Prim(max)
	for i := len(mat)-1;i >= 0;i--{
		sp := Div(mat[i],max,p)
		oksp := okdiv(mat[i],max)

		if !compareIntSlice(sp,oksp){
			fmt.Printf("->%d sp!=oksp %v != %v p=%v\n",mat[i],sp,oksp,p)
		}
	}
}
func okdiv(n,max int)[]int  {
	res := make([]int,0)
	for i := 1;i <= n&&i <= max;i++{
		if n%i == 0{
			res = append(res,i)
		}
	}
	return res
}
func compareIntSlice(a,b []int)bool{
	lena := len(a)
	lenb := len(b)
	if lena != lenb {
		return false
	}
	for i:= 0 ;i < lena;i++{
		if a[i] != b[i]{
			return false
		}
	}
	return  true
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

func Prim(n int)[]int{
	p := make([]int,0)
	flag := make([]bool,n+1)
	for i:=2;i*i <= n;i++{
		if flag[i] == false{
			for j:= 2 ;i*j <= n ;j++{
				flag[i*j] = true
			}
		}
	}
	for i := 2;i <= n;i++{
		if flag[i] == false{
			p = append(p,i)
		}
	}
	return p
}
func Div(n int,max int,p []int)[]int{
	if max > n{
		max = n
	}
	res := make([]int,0)
	res = append(res,1)
	if n>1 && n <= max{
		res = append(res,n)
	}
	var lent = len(p)
	for i:= 0;i < lent&&p[i] <= n/2;i++{
		if n%p[i] != 0{
			continue
		}
		var tl int = len(res)
		newres := make([]int,0)
		for m :=p[i];n%p[i] == 0; n/=p[i]{
			for j := 0;j < tl;j++{
				if res[j]*m <=max &&res[j]*m < n{
					if res[j]*m <= 0{
						fmt.Print("res=",res[j]," m=",m,"\n")
					}
					newres = append(newres, res[j]*m)
				}
			}
			m *=p[i]
		}
		res = append(res,newres...)
		//fmt.Printf("res=%v",res)
	}
	sort.Ints(res)
	return res
}
func Solve(n int,mat []int)  {
	var mod int64=1000000007
	var max int = 0
	for i := 0;i < n;i++{
		if mat[i] > max{
			max = mat[i]
		}
	}
	if max > n{
		max = n
	}
	p := Prim(max)
	//	fmt.Print("p=",p,"\n")
	var sum int64=0
	dp := make([]int64,max+1)
	dp[0] = int64(1)
	for i := 0;i < n;i++{
		d := Div(mat[i],max,p)
		//	fmt.Print(d)
		//	fmt.Printf("\n")
		for j:= len(d)-1;j >= 0;j--{
			if d[j] <= 0||d[j] > max{
				fmt.Print("ERROR, unexpect d!!!! mat=",mat[i]," ,d=",d)
				return
			}
			dp[d[j]] =(dp[d[j]]+ dp[d[j]-1])%mod
			sum  = (sum+dp[d[j]-1])%mod
			//		fmt.Print("dp=",dp[d[j]-1],",sum=",sum,"\n")
		}
	}
	fmt.Print(sum)
}
func main(){

	buf := bufio.NewReader(os.Stdin)
	var n int
	fmt.Fscanf(buf, "%d\n", &n)
	mat := make([]int,n)
	for i := 0;i < n;i++{
		fmt.Fscanf(buf,"%d",&mat[i])
	}
	Solve(n,mat)
	//HackC()
}

func HackC()  {
	var n int = 50
	var mat []int = []int{170081,797965,40736,224325,102476,20832,954026,923972,391400,247099,95141,927386,79799,749285,104039,200818,623552,872203,355273,838168,352783,850365,389351,930945,847154,608047,727586,549184,520573,608953,338849,536466,345479,589848,882827,771475,874283,787115,992590,128903,97800,74550,674140,282514,510849,106786,267881,163456,753022,925051}
	Solve(n,mat)
	var max int = 0
	for i := 0;i < n;i++{
		if mat[i] > max{
			max = mat[i]
		}
	}
	if max > n{
		max = n
	}
	p := Prim(max)
	for i := len(mat)-1;i >= 0;i--{
		sp := Div(mat[i],max,p)
		oksp := okdiv(mat[i],max)
		if !compareIntSlice(sp,oksp){
			fmt.Printf("sp!=oksp %v != %v",sp,oksp)
		}
	}
}
func okdiv(n,max int)[]int  {
	res := make([]int,0)
	for i := 1;i <= n&&i <= max;i++{
		if n%i == 0{
			res = append(res,i)
		}
	}
	return res
}
func compareIntSlice(a,b []int)bool{
	lena := len(a)
	lenb := len(b)
	if lena != lenb {
		return false
	}
	for i:= 0 ;i < lena;i++{
		if a[i] != b[i]{
			return false
		}
	}
	return  true
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

func Prim(n int)[]int{
	p := make([]int,0)
	flag := make([]bool,n+1)
	for i:=2;i*i <= n;i++{
		if flag[i] == false{
			for j:= 2 ;i*j <= n ;j++{
				flag[i*j] = true
			}
		}
	}
	for i := 2;i <= n;i++{
		if flag[i] == false{
			p = append(p,i)
		}
	}
	return p
}
func Div(n int,max int,p []int)[]int{
	if max > n{
		max = n
	}
	res := make([]int,0)
	res = append(res,1)
	if n>1 && n <= max{
		res = append(res,n)
	}
	var lent = len(p)
	var nn int = n
	for i:= 0;i < lent&&p[i] <= nn/2;i++{
		if n%p[i] != 0{
			continue
		}
		var tl int = len(res)
		newres := make([]int,0)
		for m :=p[i]; n%p[i] == 0; n/=p[i]{
			for j := 0;j < tl;j++{
				if res[j]*m <=max &&res[j]*m < n{
					if res[j]*m <= 0{
						fmt.Print("res=",res[j]," m=",m,"\n")
					}
					newres = append(newres, res[j]*m)
				}
			}
			m *=m
		}
		res = append(res,newres...)
		//fmt.Printf("res=%v",res)
	}
	sort.Ints(res)
	return res
}
func Solve(n int,mat []int)  {
	var mod int64=1000000007
	var max int = 0
	for i := 0;i < n;i++{
		if mat[i] > max{
			max = mat[i]
		}
	}
	if max > n{
		max = n
	}
	p := Prim(max)
	//	fmt.Print("p=",p,"\n")
	var sum int64=0
	dp := make([]int64,max+1)
	dp[0] = int64(1)
	for i := 0;i < n;i++{
		d := Div(mat[i],max,p)
		//	fmt.Print(d)
		//	fmt.Printf("\n")
		for j:= len(d)-1;j >= 0;j--{
			if d[j] <= 0||d[j] > max{
				fmt.Print("ERROR, unexpect d!!!! mat=",mat[i]," ,d=",d)
				return
			}
			dp[d[j]] =(dp[d[j]]+ dp[d[j]-1])%mod
			sum  = (sum+dp[d[j]-1])%mod
			//		fmt.Print("dp=",dp[d[j]-1],",sum=",sum,"\n")
		}
	}
	fmt.Print(sum)
}
func main(){

	buf := bufio.NewReader(os.Stdin)
	var n int
	fmt.Fscanf(buf, "%d\n", &n)
	mat := make([]int,n)
	for i := 0;i < n;i++{
		fmt.Fscanf(buf,"%d",&mat[i])
	}
	Solve(n,mat)
	//HackC()
}

func HackC()  {
	var n int = 50
	var mat []int = []int{170081,797965,40736,224325,102476,20832,954026,923972,391400,247099,95141,927386,79799,749285,104039,200818,623552,872203,355273,838168,352783,850365,389351,930945,847154,608047,727586,549184,520573,608953,338849,536466,345479,589848,882827,771475,874283,787115,992590,128903,97800,74550,674140,282514,510849,106786,267881,163456,753022,925051}
	Solve(n,mat)
	var max int = 0
	for i := 0;i < n;i++{
		if mat[i] > max{
			max = mat[i]
		}
	}
	if max > n{
		max = n
	}
	p := Prim(max)
	for i := len(mat)-1;i >= 0;i--{
		sp := Div(mat[i],max,p)
		oksp := okdiv(mat[i],max)
		if !compareIntSlice(sp,oksp){
			fmt.Printf("sp!=oksp %v != %v",sp,oksp)
		}
	}
}
func okdiv(n,max int)[]int  {
	res := make([]int,0)
	for i := 1;i <= n&&i <= max;i++{
		if n%i == 0{
			res = append(res,i)
		}
	}
	return res
}
func compareIntSlice(a,b []int)bool{
	lena := len(a)
	lenb := len(b)
	if lena != lenb {
		return false
	}
	for i:= 0 ;i < lena;i++{
		if a[i] != b[i]{
			return false
		}
	}
	return  true
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

var cache map[int64][]int = make(map[int64][]int)
func Prim(n int)[]int{
	p := make([]int,0)
	flag := make([]bool,n+1)
	for i:=2;i*i <= n;i++{
		if flag[i] == false{
			for j:= 2 ;i*j <= n ;j++{
				flag[i*j] = true
			}
		}
	}
	for i := 2;i <= n;i++{
		if flag[i] == false{
			p = append(p,i)
		}
	}
	return p
}
func Div(n int  ,max int64,p []int)[]int{

	var nn int64= int64(n)
	c,ok := cache[nn]
	if ok{
		return c
	}
	if max > int64(n){
		max =int64( n)
	}
	res := make([]int,0)
	res = append(res,1)
	if n>1 && int64(n) <= max{
		res = append(res,n)
	}
	var lent = len(p)

//	fmt.Printf("n=%d lent=%d\n",n,lent)
	for i:= 0;i < lent&&p[i] <= n;i++{
		if n%p[i] != 0{
			continue
		}
//		fmt.Printf("===get div %d\n",p[i])
		var tl int = len(res)
		newres := make([]int,0)
		for m :=p[i];n%p[i] == 0; n/=p[i]{
			for j := 0;j < tl;j++{
				var tmpd int64 = int64(m)
				tmpd *= int64(res[j])
				if tmpd <=max &&tmpd < nn {
					if tmpd<= 0{
						fmt.Print("res=",res[j]," m=",m,"\n")
					}
					newres = append(newres, res[j]*m)
				}
			}
			m *=p[i]
		}
		res = append(res,newres...)
		//fmt.Printf("res=%v",res)
	}
	sort.Ints(res)
	cache[nn]=res
	return res
}
func Solve(n int,mat []int)  {
	var mod int64=1000000007
	var max int = 0
	for i := 0;i < n;i++{
		if mat[i] > max{
			max = mat[i]
		}
	}
	if max > n{
		max = n
	}
	p := Prim(max)
	//	fmt.Print("p=",p,"\n")
	var sum int64=0
	dp := make([]int64,max+1)
	dp[0] = int64(1)
	for i := 0;i < n;i++{
		d := Div(mat[i],int64(max),p)
	//		fmt.Print(d)
		//	fmt.Printf("\n")
		for j:= len(d)-1;j >= 0;j--{
			if d[j] <= 0||d[j] > max{
				fmt.Print("ERROR, unexpect d!!!! mat=",mat[i]," ,d=",d)
				return
			}
			dp[d[j]] =(dp[d[j]]+ dp[d[j]-1])%mod
			sum  = (sum+dp[d[j]-1])%mod
			//		fmt.Print("dp=",dp[d[j]-1],",sum=",sum,"\n")
		}
	}
	fmt.Print(sum)
}
func main(){

	buf := bufio.NewReader(os.Stdin)
	var n int
	fmt.Fscanf(buf, "%d\n", &n)
	mat := make([]int,n)
	for i := 0;i < n;i++{
		fmt.Fscanf(buf,"%d",&mat[i])
	}
	Solve(n,mat)
	//HackC()
}

func HackC()  {
	var n int = 72
	var mat []int = []int{383353,171666,386523,224379,150402,72524,81041,782234,486385,797836,794110,339698,774209,495068,912228,964393,944290,204638,73597,629048,113397,889283,312566,901932,599889,926485,583023,6632,766273,314862,166844,938593,689924,614015,818471,118112,51020,638346,801899,719300,916735,561257,173626,954749,626873,368197,965305,345106,803464,669983,863487,949532,572463,733386,375129,792457,67427,747310,5449,440026,974097,691335,254210,71525,654102,737445,791470,559123,649285,504554,115752,644067,101349}
	//var n int = 1
	//var mat []int = []int{964393}

	//	Solve(n,mat)
	var max int = 0
	for i := 0;i < n;i++{
		if mat[i] > max{
			max = mat[i]
		}
	}
	if max > n{
		max = n
	}
	p := Prim(max)
	for i := len(mat)-1;i >= 0;i--{
		sp := Div(mat[i],int64(max),p)
		oksp := okdiv(mat[i],max)

		if !compareIntSlice(sp,oksp){
			fmt.Printf("->%d sp!=oksp %v != %v p=%v\n",mat[i],sp,oksp,p)
		}
	}
}
func okdiv(n,max int)[]int  {
	res := make([]int,0)
	for i := 1;i <= n&&i <= max;i++{
		if n%i == 0{
			res = append(res,i)
		}
	}
	return res
}
func compareIntSlice(a,b []int)bool{
	lena := len(a)
	lenb := len(b)
	if lena != lenb {
		return false
	}
	for i:= 0 ;i < lena;i++{
		if a[i] != b[i]{
			return false
		}
	}
	return  true
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

func Prim(n int)[]int{
	p := make([]int,0)
	flag := make([]bool,n+1)
	for i:=2;i*i <= n;i++{
		if flag[i] == false{
			for j:= 2 ;i*j <= n ;j++{
				flag[i*j] = true
			}
		}
	}
	for i := 2;i <= n;i++{
		if flag[i] == false{
			p = append(p,i)
		}
	}
	return p
}
func Div(n int,max int,p []int)[]int{
	if max > n{
		max = n
	}
	res := make([]int,0)
	res = append(res,1)
	if n>1 && n <= max{
		res = append(res,n)
	}
	var lent = len(p)
	var nn int = n
	for i:= 0;i < lent&&p[i] <= nn/2;i++{
		if n%p[i] != 0{
			continue
		}
		var tl int = len(res)
		newres := make([]int,0)
		for m :=p[i]; n%p[i] == 0; n/=p[i]{
			for j := 0;j < tl;j++{
				if res[j]*m <=max &&res[j]*m < n{
					if res[j]*m < 0{
						fmt.Print("res=",res[j]," m=",m,"\n")
					}
					newres = append(newres, res[j]*m)
				}
			}
			m *=m
		}
		res = append(res,newres...)
		//fmt.Printf("res=%v",res)
	}
	sort.Ints(res)
	return res
}
func Solve(n int,mat []int)  {
	var mod int64=1000000007
	var max int = 0
	for i := 0;i < n;i++{
		if mat[i] > max{
			max = mat[i]
		}
	}
	if max > n{
		max = n
	}
	p := Prim(max)
	//	fmt.Print("p=",p,"\n")
	var sum int64=0
	dp := make([]int64,max+1)
	dp[0] = int64(1)
	for i := 0;i < n;i++{
		d := Div(mat[i],max,p)
		//	fmt.Print(d)
		//	fmt.Printf("\n")
		for j:= len(d)-1;j >= 0;j--{
			if d[j] <= 0||d[j] > max{
				fmt.Print("ERROR, unexpect d!!!! mat=",mat[i]," ,d=",d)
				return
			}
			dp[d[j]] =(dp[d[j]]+ dp[d[j]-1])%mod
			sum  = (sum+dp[d[j]-1])%mod
			//		fmt.Print("dp=",dp[d[j]-1],",sum=",sum,"\n")
		}
	}
	fmt.Print(sum)
}
func main(){

	buf := bufio.NewReader(os.Stdin)
	var n int
	fmt.Fscanf(buf, "%d\n", &n)
	mat := make([]int,n)
	for i := 0;i < n;i++{
		fmt.Fscanf(buf,"%d",&mat[i])
	}
	Solve(n,mat)
	//HackC()
}

func HackC()  {
	var n int = 50
	var mat []int = []int{170081,797965,40736,224325,102476,20832,954026,923972,391400,247099,95141,927386,79799,749285,104039,200818,623552,872203,355273,838168,352783,850365,389351,930945,847154,608047,727586,549184,520573,608953,338849,536466,345479,589848,882827,771475,874283,787115,992590,128903,97800,74550,674140,282514,510849,106786,267881,163456,753022,925051}
	Solve(n,mat)
	var max int = 0
	for i := 0;i < n;i++{
		if mat[i] > max{
			max = mat[i]
		}
	}
	if max > n{
		max = n
	}
	p := Prim(max)
	for i := len(mat)-1;i >= 0;i--{
		sp := Div(mat[i],max,p)
		oksp := okdiv(mat[i],max)
		if !compareIntSlice(sp,oksp){
			fmt.Printf("sp!=oksp %v != %v",sp,oksp)
		}
	}
}
func okdiv(n,max int)[]int  {
	res := make([]int,0)
	for i := 1;i <= n&&i <= max;i++{
		if n%i == 0{
			res = append(res,i)
		}
	}
	return res
}
func compareIntSlice(a,b []int)bool{
	lena := len(a)
	lenb := len(b)
	if lena != lenb {
		return false
	}
	for i:= 0 ;i < lena;i++{
		if a[i] != b[i]{
			return false
		}
	}
	return  true
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

func Prim(n int)[]int{
	p := make([]int,0)
	flag := make([]bool,n+1)
	for i:=2;i*i <= n;i++{
		if flag[i] == false{
			for j:= 2 ;i*j <= n ;j++{
				flag[i*j] = true
			}
		}
	}
	for i := 2;i <= n;i++{
		if flag[i] == false{
			p = append(p,i)
		}
	}
	return p
}
func Div(n int,max int,p []int)[]int{
	if max > n{
		max = n
	}
	res := make([]int,0)
	res = append(res,1)
	if n>1 && n <= max{
		res = append(res,n)
	}
	var lent = len(p)
	var nn int = n
	for i:= 0;i < lent&&p[i] <= nn/2;i++{
		if n%p[i] != 0{
			continue
		}
		var tl int = len(res)
		newres := make([]int,0)
		for m :=p[i];n%p[i] == 0; n/=p[i]{
			for j := 0;j < tl;j++{
				if res[j]*m <=max &&res[j]*m < n{
					if res[j]*m <= 0{
						fmt.Print("res=",res[j]," m=",m,"\n")
					}
					newres = append(newres, res[j]*m)
				}
			}
			m *=p[i]
		}
		res = append(res,newres...)
		//fmt.Printf("res=%v",res)
	}
	sort.Ints(res)
	return res
}
func Solve(n int,mat []int)  {
	var mod int64=1000000007
	var max int = 0
	for i := 0;i < n;i++{
		if mat[i] > max{
			max = mat[i]
		}
	}
	if max > n{
		max = n
	}
	p := Prim(max)
	//	fmt.Print("p=",p,"\n")
	var sum int64=0
	dp := make([]int64,max+1)
	dp[0] = int64(1)
	for i := 0;i < n;i++{
		d := Div(mat[i],max,p)
		//	fmt.Print(d)
		//	fmt.Printf("\n")
		for j:= len(d)-1;j >= 0;j--{
			if d[j] <= 0||d[j] > max{
				fmt.Print("ERROR, unexpect d!!!! mat=",mat[i]," ,d=",d)
				return
			}
			dp[d[j]] =(dp[d[j]]+ dp[d[j]-1])%mod
			sum  = (sum+dp[d[j]-1])%mod
			//		fmt.Print("dp=",dp[d[j]-1],",sum=",sum,"\n")
		}
	}
	fmt.Print(sum)
}
func main(){

	buf := bufio.NewReader(os.Stdin)
	var n int
	fmt.Fscanf(buf, "%d\n", &n)
	mat := make([]int,n)
	for i := 0;i < n;i++{
		fmt.Fscanf(buf,"%d",&mat[i])
	}
	Solve(n,mat)
	//HackC()
}

func HackC()  {
	var n int = 50
	var mat []int = []int{170081,797965,40736,224325,102476,20832,954026,923972,391400,247099,95141,927386,79799,749285,104039,200818,623552,872203,355273,838168,352783,850365,389351,930945,847154,608047,727586,549184,520573,608953,338849,536466,345479,589848,882827,771475,874283,787115,992590,128903,97800,74550,674140,282514,510849,106786,267881,163456,753022,925051}
	Solve(n,mat)
	var max int = 0
	for i := 0;i < n;i++{
		if mat[i] > max{
			max = mat[i]
		}
	}
	if max > n{
		max = n
	}
	p := Prim(max)
	for i := len(mat)-1;i >= 0;i--{
		sp := Div(mat[i],max,p)
		oksp := okdiv(mat[i],max)
		if !compareIntSlice(sp,oksp){
			fmt.Printf("sp!=oksp %v != %v",sp,oksp)
		}
	}
}
func okdiv(n,max int)[]int  {
	res := make([]int,0)
	for i := 1;i <= n&&i <= max;i++{
		if n%i == 0{
			res = append(res,i)
		}
	}
	return res
}
func compareIntSlice(a,b []int)bool{
	lena := len(a)
	lenb := len(b)
	if lena != lenb {
		return false
	}
	for i:= 0 ;i < lena;i++{
		if a[i] != b[i]{
			return false
		}
	}
	return  true
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

func Prim(n int)[]int{
	p := make([]int,0)
	flag := make([]bool,n+1)
	for i:=2;i*i <= n;i++{
		if flag[i] == false{
			for j:= 2 ;i*j <= n ;j++{
				flag[i*j] = true
			}
		}
	}
	for i := 2;i <= n;i++{
		if flag[i] == false{
			p = append(p,i)
		}
	}
	return p
}
func Div(n int,max int,p []int)[]int{
	if max > n{
		max = n
	}
	res := make([]int,0)
	res = append(res,1)
	if n>1 && n <= max{
		res = append(res,n)
	}
	var lent = len(p)

//	fmt.Printf("n=%d lent=%d\n",n,lent)
	for i:= 0;i < lent&&p[i] <= n;i++{
		if n%p[i] != 0{
			continue
		}
//		fmt.Printf("===get div %d\n",p[i])
		var tl int = len(res)
		newres := make([]int,0)
		for m :=p[i];n%p[i] == 0; n/=p[i]{
			for j := 0;j < tl;j++{
				if res[j]*m <=max{
					if res[j]*m <= 0{
						fmt.Print("res=",res[j]," m=",m,"\n")
					}
					newres = append(newres, res[j]*m)
				}
			}
			m *=p[i]
		}
		res = append(res,newres...)
		//fmt.Printf("res=%v",res)
	}
	sort.Ints(res)
	return res
}
func Solve(n int,mat []int)  {
	var mod int64=1000000007
	var max int = 0
	for i := 0;i < n;i++{
		if mat[i] > max{
			max = mat[i]
		}
	}
	if max > n{
		max = n
	}
	p := Prim(max)
	//	fmt.Print("p=",p,"\n")
	var sum int64=0
	dp := make([]int64,max+1)
	dp[0] = int64(1)
	for i := 0;i < n;i++{
		d := Div(mat[i],max,p)
		//	fmt.Print(d)
		//	fmt.Printf("\n")
		for j:= len(d)-1;j >= 0;j--{
			if d[j] <= 0||d[j] > max{
				fmt.Print("ERROR, unexpect d!!!! mat=",mat[i]," ,d=",d)
				return
			}
			dp[d[j]] =(dp[d[j]]+ dp[d[j]-1])%mod
			sum  = (sum+dp[d[j]-1])%mod
			//		fmt.Print("dp=",dp[d[j]-1],",sum=",sum,"\n")
		}
	}
	fmt.Print(sum)
}
func main(){

	buf := bufio.NewReader(os.Stdin)
	var n int
	fmt.Fscanf(buf, "%d\n", &n)
	mat := make([]int,n)
	for i := 0;i < n;i++{
		fmt.Fscanf(buf,"%d",&mat[i])
	}
	Solve(n,mat)
	//HackC()
}

func HackC()  {
	var n int = 72
	var mat []int = []int{383353,171666,386523,224379,150402,72524,81041,782234,486385,797836,794110,339698,774209,495068,912228,964393,944290,204638,73597,629048,113397,889283,312566,901932,599889,926485,583023,6632,766273,314862,166844,938593,689924,614015,818471,118112,51020,638346,801899,719300,916735,561257,173626,954749,626873,368197,965305,345106,803464,669983,863487,949532,572463,733386,375129,792457,67427,747310,5449,440026,974097,691335,254210,71525,654102,737445,791470,559123,649285,504554,115752,644067,101349}
	//var n int = 1
	//var mat []int = []int{964393}

	//	Solve(n,mat)
	var max int = 0
	for i := 0;i < n;i++{
		if mat[i] > max{
			max = mat[i]
		}
	}
	if max > n{
		max = n
	}
	p := Prim(max)
	for i := len(mat)-1;i >= 0;i--{
		sp := Div(mat[i],max,p)
		oksp := okdiv(mat[i],max)
	//	fmt.Printf("->%d sp!=oksp %v != %v p=%v\n",mat[i],sp,oksp,p)
		if !compareIntSlice(sp,oksp){
			fmt.Printf("->%d sp!=oksp %v != %v p=%v\n",mat[i],sp,oksp,p)
		}
	}
}
func okdiv(n,max int)[]int  {
	res := make([]int,0)
	for i := 1;i <= n&&i <= max;i++{
		if n%i == 0{
			res = append(res,i)
		}
	}
	return res
}
func compareIntSlice(a,b []int)bool{
	lena := len(a)
	lenb := len(b)
	if lena != lenb {
		return false
	}
	for i:= 0 ;i < lena;i++{
		if a[i] != b[i]{
			return false
		}
	}
	return  true
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

func Prim(n int)[]int{
	p := make([]int,0)
	flag := make([]bool,n+1)
	for i:=2;i*i <= n;i++{
		if flag[i] == false{
			for j:= 2 ;i*j <= n ;j++{
				flag[i*j] = true
			}
		}
	}
	for i := 2;i <= n;i++{
		if flag[i] == false{
			p = append(p,i)
		}
	}
	return p
}
func Div(n int  ,max int64,p []int)[]int{
	if max > int64(n){
		max =int64( n)
	}
	res := make([]int,0)
	res = append(res,1)
	if n>1 && int64(n) <= max{
		res = append(res,n)
	}
	var lent = len(p)
	var nn int64= int64(n)
//	fmt.Printf("n=%d lent=%d\n",n,lent)
	for i:= 0;i < lent&&p[i] <= n;i++{
		if n%p[i] != 0{
			continue
		}
//		fmt.Printf("===get div %d\n",p[i])
		var tl int = len(res)
		newres := make([]int,0)
		for m :=p[i];n%p[i] == 0; n/=p[i]{
			for j := 0;j < tl;j++{
				var tmpd int64 = int64(m)
				tmpd *= int64(res[j])
				if tmpd <=max &&tmpd < nn {
					if tmpd<= 0{
						fmt.Print("res=",res[j]," m=",m,"\n")
					}
					newres = append(newres, res[j]*m)
				}
			}
			m *=p[i]
		}
		res = append(res,newres...)
		//fmt.Printf("res=%v",res)
	}
	sort.Ints(res)
	return res
}
func Solve(n int,mat []int)  {
	var mod int64=1000000007
	var max int = 0
	for i := 0;i < n;i++{
		if mat[i] > max{
			max = mat[i]
		}
	}
	if max > n{
		max = n
	}
	p := Prim(max)
	//	fmt.Print("p=",p,"\n")
	var sum int64=0
	dp := make([]int64,max+1)
	dp[0] = int64(1)
	for i := 0;i < n;i++{
		d := Div(mat[i],int64(max),p)
	//		fmt.Print(d)
		//	fmt.Printf("\n")
		for j:= len(d)-1;j >= 0;j--{
			if d[j] <= 0||d[j] > max{
				fmt.Print("ERROR, unexpect d!!!! mat=",mat[i]," ,d=",d)
				return
			}
			dp[d[j]] =(dp[d[j]]+ dp[d[j]-1])%mod
			sum  = (sum+dp[d[j]-1])%mod
			//		fmt.Print("dp=",dp[d[j]-1],",sum=",sum,"\n")
		}
	}
	fmt.Print(sum)
}
func main(){

	buf := bufio.NewReader(os.Stdin)
	var n int
	fmt.Fscanf(buf, "%d\n", &n)
	mat := make([]int,n)
	for i := 0;i < n;i++{
		fmt.Fscanf(buf,"%d",&mat[i])
	}
	Solve(n,mat)
	//HackC()
}

func HackC()  {
	var n int = 72
	var mat []int = []int{383353,171666,386523,224379,150402,72524,81041,782234,486385,797836,794110,339698,774209,495068,912228,964393,944290,204638,73597,629048,113397,889283,312566,901932,599889,926485,583023,6632,766273,314862,166844,938593,689924,614015,818471,118112,51020,638346,801899,719300,916735,561257,173626,954749,626873,368197,965305,345106,803464,669983,863487,949532,572463,733386,375129,792457,67427,747310,5449,440026,974097,691335,254210,71525,654102,737445,791470,559123,649285,504554,115752,644067,101349}
	//var n int = 1
	//var mat []int = []int{964393}

	//	Solve(n,mat)
	var max int = 0
	for i := 0;i < n;i++{
		if mat[i] > max{
			max = mat[i]
		}
	}
	if max > n{
		max = n
	}
	p := Prim(max)
	for i := len(mat)-1;i >= 0;i--{
		sp := Div(mat[i],int64(max),p)
		oksp := okdiv(mat[i],max)

		if !compareIntSlice(sp,oksp){
			fmt.Printf("->%d sp!=oksp %v != %v p=%v\n",mat[i],sp,oksp,p)
		}
	}
}
func okdiv(n,max int)[]int  {
	res := make([]int,0)
	for i := 1;i <= n&&i <= max;i++{
		if n%i == 0{
			res = append(res,i)
		}
	}
	return res
}
func compareIntSlice(a,b []int)bool{
	lena := len(a)
	lenb := len(b)
	if lena != lenb {
		return false
	}
	for i:= 0 ;i < lena;i++{
		if a[i] != b[i]{
			return false
		}
	}
	return  true
}


package main

import (
	"fmt"
	"sort"
)

func Prim(n int)[]int{
	p := make([]int,0)
	flag := make([]bool,n+1)
	for i:=2;i*i <= n;i++{
		if flag[i] == false{
			for j:= 2 ;i*j <= n ;j++{
				flag[i*j] = true
			}
		}
	}
	for i := 2;i <= n;i++{
		if flag[i] == false{
			p = append(p,i)
		}
	}
	return p
}
func Div(n int,max int,p []int)[]int{
	if max > n{
		max = n
	}
	res := make([]int,0)
	res = append(res,1)
	if n>1 && n <= max{
		res = append(res,n)
	}
	var lent = len(p)

//	fmt.Printf("n=%d lent=%d\n",n,lent)
	for i:= 0;i < lent&&p[i] <= n;i++{
		if n%p[i] != 0{
			continue
		}
//		fmt.Printf("===get div %d\n",p[i])
		var tl int = len(res)
		newres := make([]int,0)
		for m :=p[i];n%p[i] == 0; n/=p[i]{
			for j := 0;j < tl;j++{
				if res[j]*m <=max{
					if res[j]*m <= 0{
						fmt.Print("res=",res[j]," m=",m,"\n")
					}
					newres = append(newres, res[j]*m)
				}
			}
			m *=p[i]
		}
		res = append(res,newres...)
		//fmt.Printf("res=%v",res)
	}
	sort.Ints(res)
	return res
}
func Solve(n int,mat []int)  {
	var mod int64=1000000007
	var max int = 0
	for i := 0;i < n;i++{
		if mat[i] > max{
			max = mat[i]
		}
	}
	if max > n{
		max = n
	}
	p := Prim(max)
	//	fmt.Print("p=",p,"\n")
	var sum int64=0
	dp := make([]int64,max+1)
	dp[0] = int64(1)
	for i := 0;i < n;i++{
		d := Div(mat[i],max,p)
		//	fmt.Print(d)
		//	fmt.Printf("\n")
		for j:= len(d)-1;j >= 0;j--{
			if d[j] <= 0||d[j] > max{
				fmt.Print("ERROR, unexpect d!!!! mat=",mat[i]," ,d=",d)
				return
			}
			dp[d[j]] =(dp[d[j]]+ dp[d[j]-1])%mod
			sum  = (sum+dp[d[j]-1])%mod
			//		fmt.Print("dp=",dp[d[j]-1],",sum=",sum,"\n")
		}
	}
	fmt.Print(sum)
}
func main(){

	//buf := bufio.NewReader(os.Stdin)
	//var n int
	//fmt.Fscanf(buf, "%d\n", &n)
	//mat := make([]int,n)
	//for i := 0;i < n;i++{
	//	fmt.Fscanf(buf,"%d",&mat[i])
	//}
	//Solve(n,mat)
	HackC()
}

func HackC()  {
	var n int = 72
	var mat []int = []int{383353,171666,386523,224379,150402,72524,81041,782234,486385,797836,794110,339698,774209,495068,912228,964393,944290,204638,73597,629048,113397,889283,312566,901932,599889,926485,583023,6632,766273,314862,166844,938593,689924,614015,818471,118112,51020,638346,801899,719300,916735,561257,173626,954749,626873,368197,965305,345106,803464,669983,863487,949532,572463,733386,375129,792457,67427,747310,5449,440026,974097,691335,254210,71525,654102,737445,791470,559123,649285,504554,115752,644067,101349}
	//var n int = 1
	//var mat []int = []int{964393}

	//	Solve(n,mat)
	var max int = 0
	for i := 0;i < n;i++{
		if mat[i] > max{
			max = mat[i]
		}
	}
	if max > n{
		max = n
	}
	p := Prim(max)
	for i := len(mat)-1;i >= 0;i--{
		sp := Div(mat[i],max,p)
		oksp := okdiv(mat[i],max)
	//	fmt.Printf("->%d sp!=oksp %v != %v p=%v\n",mat[i],sp,oksp,p)
		if !compareIntSlice(sp,oksp){
			fmt.Printf("->%d sp!=oksp %v != %v p=%v\n",mat[i],sp,oksp,p)
		}
	}
}
func okdiv(n,max int)[]int  {
	res := make([]int,0)
	for i := 1;i <= n&&i <= max;i++{
		if n%i == 0{
			res = append(res,i)
		}
	}
	return res
}
func compareIntSlice(a,b []int)bool{
	lena := len(a)
	lenb := len(b)
	if lena != lenb {
		return false
	}
	for i:= 0 ;i < lena;i++{
		if a[i] != b[i]{
			return false
		}
	}
	return  true
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

func Prim(n int)[]int{
	p := make([]int,0)
	flag := make([]bool,n+1)
	for i:=2;i*i <= n;i++{
		if flag[i] == false{
			for j:= 2 ;i*j <= n ;j++{
				flag[i*j] = true
			}
		}
	}
	for i := 2;i <= n;i++{
		if flag[i] == false{
			p = append(p,i)
		}
	}
	return p
}
func Div(n int,max int,p []int)[]int{
	if max > n{
		max = n
	}
	res := make([]int,0)
	res = append(res,1)
	if n>1 && n <= max{
		res = append(res,n)
	}
	var lent = len(p)
	for i:= 0;i < lent&&p[i] <= n/2;i++{
		if n%p[i] != 0{
			continue
		}
		var tl int = len(res)
		newres := make([]int,0)
		for m :=p[i]; n%m == 0; n/=m{
			for j := 0;j < tl;j++{
				if res[j]*m <=max &&res[j]*m < n{
					newres = append(newres, res[j]*m)
				}
			}
		}
		res = append(res,newres...)
		//fmt.Printf("res=%v",res)
	}
	sort.Ints(res)
	return res
}
func Solve(n int,mat []int)  {
	var mod int64=1000000007
	var max int = 0
	for i := 0;i < n;i++{
		if mat[i] > max{
			max = mat[i]
		}
	}
	if max > n{
		max = n
	}
	p := Prim(max)
	//	fmt.Print("p=",p,"\n")
	var sum int64=0
	dp := make([]int64,max+1)
	dp[0] = int64(1)
	for i := 0;i < n;i++{
		d := Div(mat[i],max,p)
		//	fmt.Print(d)
		//	fmt.Printf("\n")
		for j:= len(d)-1;j >= 0;j--{
			if d[j] <= 0||d[j] > max{
				fmt.Print("ERROR, unexpect d!!!! mat=",mat[i]," ,d=",d)
				return
			}
			dp[d[j]] =(dp[d[j]]+ dp[d[j]-1])%mod
			sum  = (sum+dp[d[j]-1])%mod
			//		fmt.Print("dp=",dp[d[j]-1],",sum=",sum,"\n")
		}
	}
	fmt.Print(sum)
}
func main(){

	buf := bufio.NewReader(os.Stdin)
	var n int
	fmt.Fscanf(buf, "%d\n", &n)
	mat := make([]int,n)
	for i := 0;i < n;i++{
		fmt.Fscanf(buf,"%d",&mat[i])
	}
	Solve(n,mat)
	//HackC()
}

func HackC()  {
	var n int = 50
	var mat []int = []int{170081,797965,40736,224325,102476,20832,954026,923972,391400,247099,95141,927386,79799,749285,104039,200818,623552,872203,355273,838168,352783,850365,389351,930945,847154,608047,727586,549184,520573,608953,338849,536466,345479,589848,882827,771475,874283,787115,992590,128903,97800,74550,674140,282514,510849,106786,267881,163456,753022,925051}
	Solve(n,mat)
	var max int = 0
	for i := 0;i < n;i++{
		if mat[i] > max{
			max = mat[i]
		}
	}
	if max > n{
		max = n
	}
	p := Prim(max)
	for i := len(mat)-1;i >= 0;i--{
		sp := Div(mat[i],max,p)
		oksp := okdiv(mat[i],max)
		if !compareIntSlice(sp,oksp){
			fmt.Printf("sp!=oksp %v != %v",sp,oksp)
		}
	}
}
func okdiv(n,max int)[]int  {
	res := make([]int,0)
	for i := 1;i <= n&&i <= max;i++{
		if n%i == 0{
			res = append(res,i)
		}
	}
	return res
}
func compareIntSlice(a,b []int)bool{
	lena := len(a)
	lenb := len(b)
	if lena != lenb {
		return false
	}
	for i:= 0 ;i < lena;i++{
		if a[i] != b[i]{
			return false
		}
	}
	return  true
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

func Prim(n int)[]int{
	p := make([]int,0)
	flag := make([]bool,n+1)
	for i:=2;i*i <= n;i++{
		if flag[i] == false{
			for j:= 2 ;i*j <= n ;j++{
				flag[i*j] = true
			}
		}
	}
	for i := 2;i <= n;i++{
		if flag[i] == false{
			p = append(p,i)
		}
	}
	return p
}
func Div(n int,max int,p []int)[]int{
	if max > n{
		max = n
	}
	res := make([]int,0)
	res = append(res,1)
	if n>1 && n <= max{
		res = append(res,n)
	}
	var lent = len(p)
	for i:= 0;i < lent&&p[i] <= n/2;i++{
		if n%p[i] != 0{
			continue
		}
		var tl int = len(res)
		newres := make([]int,0)
		for m :=p[i]; n%m == 0; m*=p[i]{
			for j := 0;j < tl;j++{
				if res[j]*m <=max &&res[j]*m < n{
					newres = append(newres, res[j]*m)
				}
			}
		}
		res = append(res,newres...)
		//fmt.Printf("res=%v",res)
	}
	sort.Ints(res)
	return res
}
func Solve(n int,mat []int)  {
	var mod int64=1000000007
	var max int = 0
	for i := 0;i < n;i++{
		if mat[i] > max{
			max = mat[i]
		}
	}
	if max > n{
		max = n
	}
	p := Prim(max)
	//	fmt.Print("p=",p,"\n")
	var sum int64=0
	dp := make([]int64,max+1)
	dp[0] = int64(1)
	for i := 0;i < n;i++{
		d := Div(mat[i],max,p)
		//	fmt.Print(d)
		//	fmt.Printf("\n")
		for j:= len(d)-1;j >= 0;j--{
			if d[j] <= 0||d[j] > max{
				fmt.Print("ERROR, unexpect d!!!! mat=",mat[i]," ,d=",d)
				return
			}
			dp[d[j]] =(dp[d[j]]+ dp[d[j]-1])%mod
			sum  = (sum+dp[d[j]-1])%mod
			//		fmt.Print("dp=",dp[d[j]-1],",sum=",sum,"\n")
		}
	}
	fmt.Print(sum)
}
func main(){

	buf := bufio.NewReader(os.Stdin)
	var n int
	fmt.Fscanf(buf, "%d\n", &n)
	mat := make([]int,n)
	for i := 0;i < n;i++{
		fmt.Fscanf(buf,"%d",&mat[i])
	}
	Solve(n,mat)
	//HackC()
}

func HackC()  {
	var n int = 50
	var mat []int = []int{170081,797965,40736,224325,102476,20832,954026,923972,391400,247099,95141,927386,79799,749285,104039,200818,623552,872203,355273,838168,352783,850365,389351,930945,847154,608047,727586,549184,520573,608953,338849,536466,345479,589848,882827,771475,874283,787115,992590,128903,97800,74550,674140,282514,510849,106786,267881,163456,753022,925051}
	Solve(n,mat)
	var max int = 0
	for i := 0;i < n;i++{
		if mat[i] > max{
			max = mat[i]
		}
	}
	if max > n{
		max = n
	}
	p := Prim(max)
	for i := len(mat)-1;i >= 0;i--{
		sp := Div(mat[i],max,p)
		oksp := okdiv(mat[i],max)
		if !compareIntSlice(sp,oksp){
			fmt.Printf("sp!=oksp %v != %v",sp,oksp)
		}
	}
}
func okdiv(n,max int)[]int  {
	res := make([]int,0)
	for i := 1;i <= n&&i <= max;i++{
		if n%i == 0{
			res = append(res,i)
		}
	}
	return res
}
func compareIntSlice(a,b []int)bool{
	lena := len(a)
	lenb := len(b)
	if lena != lenb {
		return false
	}
	for i:= 0 ;i < lena;i++{
		if a[i] != b[i]{
			return false
		}
	}
	return  true
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

func prim(n int)[]int{
	p := make([]int,0)
	flag := make([]bool,n+1)
	for i:=2;i*i <= n;i++{
		if flag[i] == false{
			for j:= 2 ;i*j <= n ;j++{
				flag[i*j] = true
			}
		}
	}
	for i := 2;i <= n;i++{
		if flag[i] == false{
			p = append(p,i)
		}
	}
	return p
}
func div(n int,max int,p []int)[]int{
	if max > n{
		max = n
	}
	res := make([]int,0)
	res = append(res,1)
	if n>1 && n <= max{
		res = append(res,n)
	}
	var lent = len(p)
	for i:= 0;i < lent&&p[i] <= n/2;i++{
		if n%p[i] != 0{
			continue
		}
		var tl int = len(res)
		newres := make([]int,0)
		for m :=p[i]; n%m == 0; m*=m{
			for j := 0;j < tl;j++{
				if res[j]*m <=max &&res[j]*m < n{
					newres = append(newres, res[j]*m)
				}
			}
		}
		res = append(res,newres...)
		//fmt.Printf("res=%v",res)
	}
	sort.Ints(res)
	return res
}
func main(){

	buf := bufio.NewReader(os.Stdin)
	var mod int64=1000000007
	var n int
	fmt.Fscanf(buf, "%d\n", &n)
	mat := make([]int,n)
	var max int = 0
	for i := 0;i < n;i++{
		fmt.Fscanf(buf,"%d",&mat[i])
		if mat[i] > max{
			max = mat[i]
		}
	}
	if max > n{
		max = n
	}
	p := prim(max)
//	fmt.Print("p=",p,"\n")
	var sum int64=0
	dp := make([]int64,max+1)
	dp[0] = int64(1)
	for i := 0;i < n;i++{
		d := div(mat[i],max,p)
	//	fmt.Print(d)
	//	fmt.Printf("\n")
		for j:= len(d)-1;j >= 0;j--{
			dp[d[j]] =(dp[d[j]]+ dp[d[j]-1])%mod
			sum  = (sum+dp[d[j]-1])%mod
	//		fmt.Print("dp=",dp[d[j]-1],",sum=",sum,"\n")
		}
	}
	fmt.Print(sum)
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

func Prim(n int)[]int{
	p := make([]int,0)
	flag := make([]bool,n+1)
	for i:=2;i*i <= n;i++{
		if flag[i] == false{
			for j:= 2 ;i*j <= n ;j++{
				flag[i*j] = true
			}
		}
	}
	for i := 2;i <= n;i++{
		if flag[i] == false{
			p = append(p,i)
		}
	}
	return p
}
func Div(n int,max int,p []int)[]int{
	if max > n{
		max = n
	}
	res := make([]int,0)
	res = append(res,1)
	if n>1 && n <= max{
		res = append(res,n)
	}
	var lent = len(p)
	var nn int = n
	for i:= 0;i < lent&&p[i] <= nn/2;i++{
		if n%p[i] != 0{
			continue
		}
		var tl int = len(res)
		newres := make([]int,0)
		for m :=p[i]; n%m == 0; n/=m{
			for j := 0;j < tl;j++{
				if res[j]*m <=max &&res[j]*m < n{
					newres = append(newres, res[j]*m)
				}
			}
		}
		res = append(res,newres...)
		//fmt.Printf("res=%v",res)
	}
	sort.Ints(res)
	return res
}
func Solve(n int,mat []int)  {
	var mod int64=1000000007
	var max int = 0
	for i := 0;i < n;i++{
		if mat[i] > max{
			max = mat[i]
		}
	}
	if max > n{
		max = n
	}
	p := Prim(max)
	//	fmt.Print("p=",p,"\n")
	var sum int64=0
	dp := make([]int64,max+1)
	dp[0] = int64(1)
	for i := 0;i < n;i++{
		d := Div(mat[i],max,p)
		//	fmt.Print(d)
		//	fmt.Printf("\n")
		for j:= len(d)-1;j >= 0;j--{
			if d[j] <= 0||d[j] > max{
				fmt.Print("ERROR, unexpect d!!!! mat=",mat[i]," ,d=",d)
				return
			}
			dp[d[j]] =(dp[d[j]]+ dp[d[j]-1])%mod
			sum  = (sum+dp[d[j]-1])%mod
			//		fmt.Print("dp=",dp[d[j]-1],",sum=",sum,"\n")
		}
	}
	fmt.Print(sum)
}
func main(){

	buf := bufio.NewReader(os.Stdin)
	var n int
	fmt.Fscanf(buf, "%d\n", &n)
	mat := make([]int,n)
	for i := 0;i < n;i++{
		fmt.Fscanf(buf,"%d",&mat[i])
	}
	Solve(n,mat)
	//HackC()
}

func HackC()  {
	var n int = 50
	var mat []int = []int{170081,797965,40736,224325,102476,20832,954026,923972,391400,247099,95141,927386,79799,749285,104039,200818,623552,872203,355273,838168,352783,850365,389351,930945,847154,608047,727586,549184,520573,608953,338849,536466,345479,589848,882827,771475,874283,787115,992590,128903,97800,74550,674140,282514,510849,106786,267881,163456,753022,925051}
	Solve(n,mat)
	var max int = 0
	for i := 0;i < n;i++{
		if mat[i] > max{
			max = mat[i]
		}
	}
	if max > n{
		max = n
	}
	p := Prim(max)
	for i := len(mat)-1;i >= 0;i--{
		sp := Div(mat[i],max,p)
		oksp := okdiv(mat[i],max)
		if !compareIntSlice(sp,oksp){
			fmt.Printf("sp!=oksp %v != %v",sp,oksp)
		}
	}
}
func okdiv(n,max int)[]int  {
	res := make([]int,0)
	for i := 1;i <= n&&i <= max;i++{
		if n%i == 0{
			res = append(res,i)
		}
	}
	return res
}
func compareIntSlice(a,b []int)bool{
	lena := len(a)
	lenb := len(b)
	if lena != lenb {
		return false
	}
	for i:= 0 ;i < lena;i++{
		if a[i] != b[i]{
			return false
		}
	}
	return  true
}


/*
URL:
https://codeforces.com/problemset/problem/1061/C
*/

package main

import (
	"bufio"
	"errors"
	"fmt"
	"io"
	"math"
	"os"
	"sort"
	"strconv"
)

/********** FAU standard libraries **********/

//fmt.Sprintf("%b\n", 255) 	// binary expression

/********** I/O usage **********/

//str := ReadString()
//i := ReadInt()
//X := ReadIntSlice(n)
//S := ReadRuneSlice()
//a := ReadFloat64()
//A := ReadFloat64Slice(n)

//str := ZeroPaddingRuneSlice(num, 32)
//str := PrintIntsLine(X...)

/*******************************************************************/

const (
	// General purpose
	MOD          = 1000000000 + 7
	ALPHABET_NUM = 26
	INF_INT64    = math.MaxInt64
	INF_BIT60    = 1 << 60
	INF_INT32    = math.MaxInt32
	INF_BIT30    = 1 << 30
	NIL          = -1

	// for dijkstra, prim, and so on
	WHITE = 0
	GRAY  = 1
	BLACK = 2
)

func init() {
	// bufio.ScanWords <---> bufio.ScanLines
	ReadString = newReadString(os.Stdin, bufio.ScanWords)
	stdout = bufio.NewWriter(os.Stdout)
}

var (
	n int
	A []int

	dp [100000 + 50]int64
)

func main() {
	n = ReadInt()
	A = ReadIntSlice(n)

	dp[0] = 1
	for i := 0; i < n; i++ {
		D := divisor(A[i])
		sort.Sort(sort.Reverse(sort.IntSlice(D)))

		for _, d := range D {
			if d <= i+1 {
				dp[d] += dp[d-1]
				dp[d] %= MOD
			} else {
			}
		}
	}

	ans := int64(0)
	for j := 1; j <= n; j++ {
		ans += dp[j]
		ans %= MOD
	}
	fmt.Println(ans)
}

// 約数の列挙: O(sqrt(n))
func divisor(n int) []int {
	res := []int{}

	for i := 1; i*i <= n; i++ {
		if n%i == 0 {
			res = append(res, i)
			if i != (n / i) {
				res = append(res, (n / i))
			}
		}
	}

	return res
}

/*******************************************************************/

/*********** I/O ***********/

var (
	// ReadString returns a WORD string.
	ReadString func() string
	stdout     *bufio.Writer
)

func newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces
	r.Split(sf)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

// ReadInt returns an integer.
func ReadInt() int {
	return int(readInt64())
}
func ReadInt2() (int, int) {
	return int(readInt64()), int(readInt64())
}
func ReadInt3() (int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64())
}
func ReadInt4() (int, int, int, int) {
	return int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())
}

// ReadInt64 returns as integer as int64.
func ReadInt64() int64 {
	return readInt64()
}
func ReadInt64_2() (int64, int64) {
	return readInt64(), readInt64()
}
func ReadInt64_3() (int64, int64, int64) {
	return readInt64(), readInt64(), readInt64()
}
func ReadInt64_4() (int64, int64, int64, int64) {
	return readInt64(), readInt64(), readInt64(), readInt64()
}

func readInt64() int64 {
	i, err := strconv.ParseInt(ReadString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

// ReadIntSlice returns an integer slice that has n integers.
func ReadIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt()
	}
	return b
}

// ReadInt64Slice returns as int64 slice that has n integers.
func ReadInt64Slice(n int) []int64 {
	b := make([]int64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadInt64()
	}
	return b
}

// ReadFloat64 returns an float64.
func ReadFloat64() float64 {
	return float64(readFloat64())
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(ReadString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

// ReadFloatSlice returns an float64 slice that has n float64.
func ReadFloat64Slice(n int) []float64 {
	b := make([]float64, n)
	for i := 0; i < n; i++ {
		b[i] = ReadFloat64()
	}
	return b
}

// ReadRuneSlice returns a rune slice.
func ReadRuneSlice() []rune {
	return []rune(ReadString())
}

/*********** Debugging ***********/

// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.
// For debugging use.
func ZeroPaddingRuneSlice(n, digitsNum int) []rune {
	sn := fmt.Sprintf("%b", n)

	residualLength := digitsNum - len(sn)
	if residualLength <= 0 {
		return []rune(sn)
	}

	zeros := make([]rune, residualLength)
	for i := 0; i < len(zeros); i++ {
		zeros[i] = '0'
	}

	res := []rune{}
	res = append(res, zeros...)
	res = append(res, []rune(sn)...)

	return res
}

// Strtoi is a wrapper of strconv.Atoi().
// If strconv.Atoi() returns an error, Strtoi calls panic.
func Strtoi(s string) int {
	if i, err := strconv.Atoi(s); err != nil {
		panic(errors.New("[argument error]: Strtoi only accepts integer string"))
	} else {
		return i
	}
}

// PrintIntsLine returns integers string delimited by a space.
func PrintIntsLine(A ...int) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.Itoa(A[i])
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintIntsLine returns integers string delimited by a space.
func PrintInts64Line(A ...int64) string {
	res := []rune{}

	for i := 0; i < len(A); i++ {
		str := strconv.FormatInt(A[i], 10) // 64bit int version
		res = append(res, []rune(str)...)

		if i != len(A)-1 {
			res = append(res, ' ')
		}
	}

	return string(res)
}

// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)
func PrintfDebug(format string, a ...interface{}) {
	fmt.Fprintf(os.Stderr, format, a...)
}

// PrintfBufStdout is function for output strings to buffered os.Stdout.
// You may have to call stdout.Flush() finally.
func PrintfBufStdout(format string, a ...interface{}) {
	fmt.Fprintf(stdout, format, a...)
}


package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
)

const N = 100005
const mod = int(1e9) + 7

var n int
var a[N] int
var layer [][] int
var sum [] int

func main() {
	var reader = bufio.NewReader(os.Stdin)
	var writer = bufio.NewWriter(os.Stdout)
	defer writer.Flush()
	fmt.Fscanf(reader, "%d\n", &n)

	layer = make([][]int, n + 1)

	for i := 1; i <= n; i++ {
		layer[i] = make([]int, 0)
	}

	for i := 1; i <= n; i++ {
		var val int
		fmt.Fscanf(reader, "%d", &val)
		for j := 1; j <= int(math.Sqrt(float64(val))); j++ {
			if val % j == 0 {
				if j <= n {
					layer[j] = append(layer[j], i)
				}
				var z = val / j
				if z != j && z <= n {
					layer[z] = append(layer[z], i)
				}
			}
		}
	}

	sum = make([]int, 0)

	var ret = 0
	for i := 1; i <= n; i++ {
		var newSum = make([]int, 0)

		for _, z := range layer[i] {
			var way = 1
			var sz = len(newSum)

			if i > 1 {
				way = 0
				var l = 0
				var r = len(layer[i - 1]) - 1
				var pos = -1

				for l <= r {
					var mid = (l + r) >> 1
					if layer[i - 1][mid] < z {
						pos = mid
						l = mid + 1
					} else {
						r = mid - 1
					}
				}

				if pos != -1 {
					way = sum[pos]
				}
			}

			ret = (ret + way) % mod

			if sz > 0 {
				way += newSum[sz-1]
				way %= mod
			}

			newSum = append(newSum, way)
		}
		sum, newSum = newSum, sum
	}

	fmt.Fprintf(writer, "%d\n", ret)
}


package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
)

const N = 100005
const mod = int(1e9) + 7

var n int
var a[N] int
var layer [][] int
var sum [] int

func main() {
	var reader = bufio.NewReader(os.Stdin)
	var writer = bufio.NewWriter(os.Stdout)
	defer writer.Flush()
	fmt.Fscanf(reader, "%d\n", &n)

	layer = make([][]int, n + 1)

	for i := 1; i <= n; i++ {
		var val int
		fmt.Fscanf(reader, "%d", &val)
		for j := 1; j <= int(math.Sqrt(float64(val))); j++ {
			if val % j == 0 {
				if j <= n {
					if layer[j] == nil {
						layer[j] = make([]int, 0)
					}
					layer[j] = append(layer[j], i)
				}
				var z = val / j
				if z != j && z <= n {
					if layer[z] == nil {
						layer[z] = make([]int, 0)
					}
					layer[z] = append(layer[z], i)
				}
			}
		}
	}

	sum = make([]int, 0)

	var ret = 0
	for i := 1; i <= n; i++ {
		var newSum = make([]int, 0)

		for _, z := range layer[i] {
			var way = 1
			var sz = len(newSum)

			if i > 1 {
				way = 0
				var l = 0
				var r = len(layer[i - 1]) - 1
				var pos = -1

				for l <= r {
					var mid = (l + r) >> 1
					if layer[i - 1][mid] < z {
						pos = mid
						l = mid + 1
					} else {
						r = mid - 1
					}
				}

				if pos != -1 {
					way = sum[pos]
				}
			}

			ret = (ret + way) % mod

			if sz > 0 {
				way += newSum[sz-1]
				way %= mod
			}

			newSum = append(newSum, way)
		}
		sum, newSum = newSum, sum
	}

	fmt.Fprintf(writer, "%d\n", ret)
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
)

const N = 100005
const mod = int(1e9) + 7

var n int
var a[][] int
var sum [] int

func main() {
	var reader = bufio.NewReader(os.Stdin)
	var writer = bufio.NewWriter(os.Stdout)
	defer writer.Flush()
	fmt.Fscanf(reader, "%d\n", &n)

	a = make([][]int, 1000001)
	for i := 1; i <= n; i++ {
		var val int
		fmt.Fscanf(reader, "%d", &val)
		if a[val] == nil {
			a[val] = make([]int, 0)
		}
		a[val] = append(a[val], i)
	}

	sum = make([]int, 0)
	var layer = make([]int, 0)

	var ret = 0
	for i := 1; i <= n; i++ {
		var newLayer = make([]int, 0)
		for j := i; j <= 1000000; j += i {
			if a[j] != nil {
				for _, z := range a[j] {
					newLayer = append(newLayer, z)
				}
			}
		}
		sort.Ints(newLayer)

		var newSum = make([]int, 0)

		for _, z := range newLayer {
			var way = 1
			var sz = len(newSum)

			if i > 1 {
				way = 0
				var l = 0
				var r = len(layer) - 1
				var pos = -1

				for l <= r {
					var mid = (l + r) >> 1
					if layer[mid] < z {
						pos = mid
						l = mid + 1
					} else {
						r = mid - 1
					}
				}

				if pos != -1 {
					way = sum[pos]
				}
			}

			ret = (ret + way) % mod

			if sz > 0 {
				way += newSum[sz-1]
				way %= mod
			}

			newSum = append(newSum, way)
		}
		sum, newSum = newSum, sum
		layer, newLayer = newLayer, layer
	}

	fmt.Fprintf(writer, "%d\n", ret)
}


package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
)

const N = 100005
const mod = int(1e9) + 7

var n int
var a[N] int
var layer [][] int
var sum [][] int

func main() {
	var reader = bufio.NewReader(os.Stdin)
	var writer = bufio.NewWriter(os.Stdout)
	defer writer.Flush()
	fmt.Fscanf(reader, "%d\n", &n)

	layer = make([][]int, n + 1)
	sum = make([][]int, n + 1)

	for i := 1; i <= n; i++ {
		layer[i] = make([]int, 0)
		sum[i] = make([]int, 0)
	}

	for i := 1; i <= n; i++ {
		var val int
		fmt.Fscanf(reader, "%d", &val)
		for j := 1; j <= int(math.Sqrt(float64(val))); j++ {
			if val % j == 0 {
				if j <= n {
					layer[j] = append(layer[j], i)
				}
				var z = val / j
				if z != j && z <= n {
					layer[z] = append(layer[z], i)
				}
			}
		}
	}

	var ret = 0
	for i := 1; i <= n; i++ {
		for _, z := range layer[i] {
			var way = 1
			var sz = len(sum[i])

			if i > 1 {
				way = 0
				var l = 0
				var r = len(layer[i - 1]) - 1
				var pos = -1

				for l <= r {
					var mid = (l + r) >> 1
					if layer[i - 1][mid] < z {
						pos = mid
						l = mid + 1
					} else {
						r = mid - 1
					}
				}

				if pos != -1 {
					way = sum[i - 1][pos]
				}
			}

			ret = (ret + way) % mod
			if sz > 0 {
				way += sum[i][sz-1]
				way %= mod
			}

			sum[i] = append(sum[i], way)
		}
	}

	fmt.Fprintf(writer, "%d\n", ret)
}


package main

import (
	"bufio"
	"bytes"
	"fmt"
	"os"
)

var (
	MOD = int64(1000000007)
	DIV = make([]int, 1000001)
)

func Init() {
	for i := 2; i < len(DIV); i++ {
		if DIV[i] != 0 {
			continue
		}
		DIV[i] = i
		if i > len(DIV)/i {
			continue
		}
		for j := i * i; j < len(DIV); j += i {
			DIV[j] = i
		}
	}
}

func factorsHelp(p, f []int, idx, s int, lst *[]int) {
	if idx >= len(p) {
		*lst = append(*lst, s)
		return
	}
	m := 1
	for i := 0; i <= f[idx]; i++ {
		factorsHelp(p, f, idx+1, s*m, lst)
		m *= p[idx]
	}
}

func factors(x int) []int {
	divs := make(map[int]int)
	r := x
	for r > 1 {
		divs[DIV[r]]++
		r = r / DIV[r]
	}

	var p, f []int
	for k, v := range divs {
		p = append(p, k)
		f = append(f, v)
	}

	var lst []int
	factorsHelp(p, f, 0, 1, &lst)
	return lst

	// pLen := len(p)
	// set := make(map[int]bool)
	// for i := 0; i < (1 << uint(pLen)); i++ {
	// 	f := 1
	// 	for b := 0; b < pLen; b++ {
	// 		if ((i >> uint(b)) & 1) == 1 {
	// 			f *= p[b]
	// 		}
	// 	}
	// 	set[f] = true
	// }

	// var lst []int
	// for k := range set {
	// 	lst = append(lst, k)
	// }
	// return lst
}

func Solve(io *FastIO) {
	N := io.NextInt()
	A := io.NextIntArray(N)

	dp := make([]int64, 1000001)
	next := make([]int64, 1000001)
	for _, a := range A {
		facs := factors(a)
		for _, f := range facs {
			next[f] += dp[f-1]
			next[f] %= MOD
		}
		next[1] = 1

		for _, f := range facs {
			dp[f] += next[f]
			dp[f] %= MOD

			next[f] = 0
		}
	}

	var ans int64
	for _, f := range dp {
		ans += f
		ans %= MOD
	}
	io.Println(ans)
}

type FastIO struct {
	reader *bufio.Reader
	writer *bufio.Writer
}

func (io *FastIO) NextChar() byte {
	c, _ := io.reader.ReadByte()
	return c
}

func (io *FastIO) NextInt() int {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := 1
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := 0
	for !IsSpaceChar(c) {
		res = (res * 10) + int(c-'0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextLong() int64 {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := int64(1)
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := int64(0)
	for !IsSpaceChar(c) {
		res = (res * 10) + int64(c-'0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextIntArray(size int) []int {
	return io.NextIntArrayOffset(size, 0)
}

func (io *FastIO) NextIntArrayOffset(size, offset int) []int {
	arr := make([]int, size+offset)
	for i := 0; i < size; i++ {
		arr[i+offset] = io.NextInt()
	}
	return arr
}

func (io *FastIO) NextLongArray(size int) []int64 {
	return io.NextLongArrayOffset(size, 0)
}

func (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {
	arr := make([]int64, size+offset)
	for i := 0; i < size; i++ {
		arr[i+offset] = io.NextLong()
	}
	return arr
}

func (io *FastIO) NextString() string {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsSpaceChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) NextLine() string {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsLineBreakChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) Println(args ...interface{}) {
	io.writer.WriteString(fmt.Sprintln(args...))
}

func (io *FastIO) Printf(format string, args ...interface{}) {
	io.writer.WriteString(fmt.Sprintf(format, args...))
}

func (io *FastIO) FlushOutput() {
	io.writer.Flush()
}

func IsSpaceChar(c byte) bool {
	switch c {
	case 0, '\t', '\n', '\r', ' ':
		return true
	default:
		return false
	}
}

func IsLineBreakChar(c byte) bool {
	switch c {
	case 0, '\n', '\r':
		return true
	default:
		return false
	}
}

func main() {
	io := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}
	Init()
	Solve(&io)
	io.FlushOutput()
}


package main

import (
	"bufio"
	"bytes"
	"fmt"
	"os"
)

var (
	MOD      = int64(1000000007)
	DIVISORS = make([][]int, 1000001)
)

func Init() {
	for i := 1; i <= 1000000; i++ {
		for j := i; j <= 1000000; j += i {
			DIVISORS[j] = append(DIVISORS[j], i)
		}
	}
}

func Solve(io *FastIO) {
	N := io.NextInt()
	A := io.NextIntArray(N)

	dp := make([]int64, 1000001)
	next := make([]int64, 1000001)
	for _, a := range A {
		for _, f := range DIVISORS[a] {
			next[f] += dp[f-1]
			next[f] %= MOD
		}
		next[1] = 1

		for _, f := range DIVISORS[a] {
			dp[f] += next[f]
			dp[f] %= MOD

			next[f] = 0
		}
	}

	var ans int64
	for _, f := range dp {
		ans += f
		ans %= MOD
	}
	io.Println(ans)
}

type FastIO struct {
	reader *bufio.Reader
	writer *bufio.Writer
}

func (io *FastIO) NextChar() byte {
	c, _ := io.reader.ReadByte()
	return c
}

func (io *FastIO) NextInt() int {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := 1
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := 0
	for !IsSpaceChar(c) {
		res = (res * 10) + int(c-'0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextLong() int64 {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := int64(1)
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := int64(0)
	for !IsSpaceChar(c) {
		res = (res * 10) + int64(c-'0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextIntArray(size int) []int {
	return io.NextIntArrayOffset(size, 0)
}

func (io *FastIO) NextIntArrayOffset(size, offset int) []int {
	arr := make([]int, size+offset)
	for i := 0; i < size; i++ {
		arr[i+offset] = io.NextInt()
	}
	return arr
}

func (io *FastIO) NextLongArray(size int) []int64 {
	return io.NextLongArrayOffset(size, 0)
}

func (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {
	arr := make([]int64, size+offset)
	for i := 0; i < size; i++ {
		arr[i+offset] = io.NextLong()
	}
	return arr
}

func (io *FastIO) NextString() string {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsSpaceChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) NextLine() string {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsLineBreakChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) Println(args ...interface{}) {
	io.writer.WriteString(fmt.Sprintln(args...))
}

func (io *FastIO) Printf(format string, args ...interface{}) {
	io.writer.WriteString(fmt.Sprintf(format, args...))
}

func (io *FastIO) FlushOutput() {
	io.writer.Flush()
}

func IsSpaceChar(c byte) bool {
	switch c {
	case 0, '\t', '\n', '\r', ' ':
		return true
	default:
		return false
	}
}

func IsLineBreakChar(c byte) bool {
	switch c {
	case 0, '\n', '\r':
		return true
	default:
		return false
	}
}

func main() {
	io := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}
	Init()
	Solve(&io)
	io.FlushOutput()
}


package main

import (
	"bufio"
	"bytes"
	"fmt"
	"os"
)

var (
	MOD = int64(1000000007)
	DIV = make([]int, 1000001)
)

func Init() {
	for i := 2; i < len(DIV); i++ {
		if DIV[i] != 0 {
			continue
		}
		DIV[i] = i
		if i > len(DIV)/i {
			continue
		}
		for j := i * i; j < len(DIV); j += i {
			DIV[j] = i
		}
	}
}

func factors(x int) []int {
	var p []int
	r := x
	for r > 1 {
		p = append(p, DIV[r])
		r = r / DIV[r]
	}

	pLen := len(p)
	set := make(map[int]bool)
	for i := 0; i < (1 << uint(pLen)); i++ {
		f := 1
		for b := 0; b < pLen; b++ {
			if ((i >> uint(b)) & 1) == 1 {
				f *= p[b]
			}
		}
		set[f] = true
	}

	var lst []int
	for k := range set {
		lst = append(lst, k)
	}
	return lst
}

func Solve(io *FastIO) {
	N := io.NextInt()
	A := io.NextIntArray(N)

	dp := make([]int64, 1000001)
	next := make([]int64, 1000001)
	dp[0] = 1
	for _, a := range A {
		facs := factors(a)
		for _, f := range facs {
			next[f] += dp[f-1]
			next[f] %= MOD
		}

		for f := range facs {
			dp[f] += next[f]
			dp[f] %= MOD

			next[f] = 0
		}
	}

	var ans int64
	for _, f := range dp {
		ans += f
		ans %= MOD
	}
	io.Println(ans)
}

type FastIO struct {
	reader *bufio.Reader
	writer *bufio.Writer
}

func (io *FastIO) NextChar() byte {
	c, _ := io.reader.ReadByte()
	return c
}

func (io *FastIO) NextInt() int {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := 1
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := 0
	for !IsSpaceChar(c) {
		res = (res * 10) + int(c-'0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextLong() int64 {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := int64(1)
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := int64(0)
	for !IsSpaceChar(c) {
		res = (res * 10) + int64(c-'0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextIntArray(size int) []int {
	return io.NextIntArrayOffset(size, 0)
}

func (io *FastIO) NextIntArrayOffset(size, offset int) []int {
	arr := make([]int, size+offset)
	for i := 0; i < size; i++ {
		arr[i+offset] = io.NextInt()
	}
	return arr
}

func (io *FastIO) NextLongArray(size int) []int64 {
	return io.NextLongArrayOffset(size, 0)
}

func (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {
	arr := make([]int64, size+offset)
	for i := 0; i < size; i++ {
		arr[i+offset] = io.NextLong()
	}
	return arr
}

func (io *FastIO) NextString() string {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsSpaceChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) NextLine() string {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsLineBreakChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) Println(args ...interface{}) {
	io.writer.WriteString(fmt.Sprintln(args...))
}

func (io *FastIO) Printf(format string, args ...interface{}) {
	io.writer.WriteString(fmt.Sprintf(format, args...))
}

func (io *FastIO) FlushOutput() {
	io.writer.Flush()
}

func IsSpaceChar(c byte) bool {
	switch c {
	case 0, '\t', '\n', '\r', ' ':
		return true
	default:
		return false
	}
}

func IsLineBreakChar(c byte) bool {
	switch c {
	case 0, '\n', '\r':
		return true
	default:
		return false
	}
}

func main() {
	io := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}
	Init()
	Solve(&io)
	io.FlushOutput()
}


package main

import (
	"bufio"
	"bytes"
	"fmt"
	"os"
)

var (
	MOD = int64(1000000007)
	DIV = make([]int, 1000001)
)

func Init() {
	for i := 2; i < len(DIV); i++ {
		if DIV[i] != 0 {
			continue
		}
		DIV[i] = i
		if i > len(DIV)/i {
			continue
		}
		for j := i * i; j < len(DIV); j += i {
			DIV[j] = i
		}
	}
}

func factors(x int) []int {
	var p []int
	r := x
	for r > 1 {
		p = append(p, DIV[r])
		r = r / DIV[r]
	}

	pLen := len(p)
	set := make(map[int]bool)
	for i := 0; i < (1 << uint(pLen)); i++ {
		f := 1
		for b := 0; b < pLen; b++ {
			if ((i >> uint(b)) & 1) == 1 {
				f *= p[b]
			}
		}
		set[f] = true
	}

	var lst []int
	for k := range set {
		lst = append(lst, k)
	}
	return lst
}

func Solve(io *FastIO) {
	N := io.NextInt()
	A := io.NextIntArray(N)

	dp := make([]int64, 1000001)
	next := make([]int64, 1000001)
	for _, a := range A {
		facs := factors(a)
		for _, f := range facs {
			next[f] += dp[f-1]
			next[f] %= MOD
		}
		next[1] = 1

		for _, f := range facs {
			dp[f] += next[f]
			dp[f] %= MOD

			next[f] = 0
		}
	}

	var ans int64
	for _, f := range dp {
		ans += f
		ans %= MOD
	}
	io.Println(ans)
}

type FastIO struct {
	reader *bufio.Reader
	writer *bufio.Writer
}

func (io *FastIO) NextChar() byte {
	c, _ := io.reader.ReadByte()
	return c
}

func (io *FastIO) NextInt() int {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := 1
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := 0
	for !IsSpaceChar(c) {
		res = (res * 10) + int(c-'0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextLong() int64 {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := int64(1)
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := int64(0)
	for !IsSpaceChar(c) {
		res = (res * 10) + int64(c-'0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextIntArray(size int) []int {
	return io.NextIntArrayOffset(size, 0)
}

func (io *FastIO) NextIntArrayOffset(size, offset int) []int {
	arr := make([]int, size+offset)
	for i := 0; i < size; i++ {
		arr[i+offset] = io.NextInt()
	}
	return arr
}

func (io *FastIO) NextLongArray(size int) []int64 {
	return io.NextLongArrayOffset(size, 0)
}

func (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {
	arr := make([]int64, size+offset)
	for i := 0; i < size; i++ {
		arr[i+offset] = io.NextLong()
	}
	return arr
}

func (io *FastIO) NextString() string {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsSpaceChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) NextLine() string {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsLineBreakChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) Println(args ...interface{}) {
	io.writer.WriteString(fmt.Sprintln(args...))
}

func (io *FastIO) Printf(format string, args ...interface{}) {
	io.writer.WriteString(fmt.Sprintf(format, args...))
}

func (io *FastIO) FlushOutput() {
	io.writer.Flush()
}

func IsSpaceChar(c byte) bool {
	switch c {
	case 0, '\t', '\n', '\r', ' ':
		return true
	default:
		return false
	}
}

func IsLineBreakChar(c byte) bool {
	switch c {
	case 0, '\n', '\r':
		return true
	default:
		return false
	}
}

func main() {
	io := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}
	Init()
	Solve(&io)
	io.FlushOutput()
}


package main

import (
	"bufio"
	"bytes"
	"fmt"
	"os"
)

var (
	MOD = int64(1000000007)
	DIV = make([]int, 1000001)
)

func Init() {
	for i := 2; i < len(DIV); i++ {
		if DIV[i] != 0 {
			continue
		}
		DIV[i] = i
		if i > len(DIV)/i {
			continue
		}
		for j := i * i; j < len(DIV); j += i {
			DIV[j] = i
		}
	}
}

func factorsRecur(x int, p []int, lst *[]int) {

}

func factors(x int) []int {
	var p []int
	r := x
	for r > 1 {
		p = append(p, DIV[r])
		r = r / DIV[r]
	}

	pLen := len(p)
	set := make(map[int]bool)
	for i := 0; i < (1 << uint(pLen)); i++ {
		f := 1
		for b := 0; b < pLen; b++ {
			if ((i >> uint(b)) & 1) == 1 {
				f *= p[b]
			}
		}
		set[f] = true
	}

	var lst []int
	for k := range set {
		lst = append(lst, k)
	}
	return lst
}

func Solve(io *FastIO) {
	N := io.NextInt()
	A := io.NextIntArray(N)

	dp := make(map[int]int64)
	for _, a := range A {
		next := make(map[int]int64)
		next[1] = 1
		for _, f := range factors(a) {
			next[f] += dp[f-1]
			next[f] %= MOD
		}

		for k, f := range next {
			dp[k] += f
			dp[k] %= MOD
		}
	}

	var ans int64
	for _, f := range dp {
		ans += f
		ans %= MOD
	}
	io.Println(ans)
}

type FastIO struct {
	reader *bufio.Reader
	writer *bufio.Writer
}

func (io *FastIO) NextChar() byte {
	c, _ := io.reader.ReadByte()
	return c
}

func (io *FastIO) NextInt() int {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := 1
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := 0
	for !IsSpaceChar(c) {
		res = (res * 10) + int(c-'0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextLong() int64 {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := int64(1)
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := int64(0)
	for !IsSpaceChar(c) {
		res = (res * 10) + int64(c-'0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextIntArray(size int) []int {
	return io.NextIntArrayOffset(size, 0)
}

func (io *FastIO) NextIntArrayOffset(size, offset int) []int {
	arr := make([]int, size+offset)
	for i := 0; i < size; i++ {
		arr[i+offset] = io.NextInt()
	}
	return arr
}

func (io *FastIO) NextLongArray(size int) []int64 {
	return io.NextLongArrayOffset(size, 0)
}

func (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {
	arr := make([]int64, size+offset)
	for i := 0; i < size; i++ {
		arr[i+offset] = io.NextLong()
	}
	return arr
}

func (io *FastIO) NextString() string {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsSpaceChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) NextLine() string {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsLineBreakChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) Println(args ...interface{}) {
	io.writer.WriteString(fmt.Sprintln(args...))
}

func (io *FastIO) Printf(format string, args ...interface{}) {
	io.writer.WriteString(fmt.Sprintf(format, args...))
}

func (io *FastIO) FlushOutput() {
	io.writer.Flush()
}

func IsSpaceChar(c byte) bool {
	switch c {
	case 0, '\t', '\n', '\r', ' ':
		return true
	default:
		return false
	}
}

func IsLineBreakChar(c byte) bool {
	switch c {
	case 0, '\n', '\r':
		return true
	default:
		return false
	}
}

func main() {
	io := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}
	Init()
	Solve(&io)
	io.FlushOutput()
}


package main

import (
	"bufio"
	"bytes"
	"fmt"
	"os"
)

var (
	MOD = int64(1000000007)
)

func Init() {
}

func Solve(io *FastIO) {
	N := io.NextInt()
	A := io.NextIntArray(N)

	dp := make(map[int]int64)
	for _, a := range A {
		next := make(map[int]int64)
		next[1] = 1
		for i := 1; i*i <= a; i++ {
			if a%i != 0 {
				continue
			}
			next[i] += dp[i-1]
			next[i] %= MOD

			j := a / i
			if j == i {
				continue
			}
			next[j] += dp[j-1]
			next[j] %= MOD
		}

		for k, f := range next {
			dp[k] += f
			dp[k] %= MOD
		}
	}

	var ans int64
	for _, f := range dp {
		ans += f
		ans %= MOD
	}
	io.Println(ans)
}

type FastIO struct {
	reader *bufio.Reader
	writer *bufio.Writer
}

func (io *FastIO) NextChar() byte {
	c, _ := io.reader.ReadByte()
	return c
}

func (io *FastIO) NextInt() int {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := 1
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := 0
	for !IsSpaceChar(c) {
		res = (res * 10) + int(c-'0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextLong() int64 {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	sgn := int64(1)
	if c == '-' {
		sgn = -1
		c = io.NextChar()
	}
	res := int64(0)
	for !IsSpaceChar(c) {
		res = (res * 10) + int64(c-'0')
		c = io.NextChar()
	}
	return sgn * res
}

func (io *FastIO) NextIntArray(size int) []int {
	return io.NextIntArrayOffset(size, 0)
}

func (io *FastIO) NextIntArrayOffset(size, offset int) []int {
	arr := make([]int, size+offset)
	for i := 0; i < size; i++ {
		arr[i+offset] = io.NextInt()
	}
	return arr
}

func (io *FastIO) NextLongArray(size int) []int64 {
	return io.NextLongArrayOffset(size, 0)
}

func (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {
	arr := make([]int64, size+offset)
	for i := 0; i < size; i++ {
		arr[i+offset] = io.NextLong()
	}
	return arr
}

func (io *FastIO) NextString() string {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsSpaceChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) NextLine() string {
	c := io.NextChar()
	for IsSpaceChar(c) {
		c = io.NextChar()
	}
	var sb bytes.Buffer
	for !IsLineBreakChar(c) {
		sb.WriteByte(c)
		c = io.NextChar()
	}
	return sb.String()
}

func (io *FastIO) Println(args ...interface{}) {
	io.writer.WriteString(fmt.Sprintln(args...))
}

func (io *FastIO) Printf(format string, args ...interface{}) {
	io.writer.WriteString(fmt.Sprintf(format, args...))
}

func (io *FastIO) FlushOutput() {
	io.writer.Flush()
}

func IsSpaceChar(c byte) bool {
	switch c {
	case 0, '\t', '\n', '\r', ' ':
		return true
	default:
		return false
	}
}

func IsLineBreakChar(c byte) bool {
	switch c {
	case 0, '\n', '\r':
		return true
	default:
		return false
	}
}

func main() {
	io := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}
	Init()
	Solve(&io)
	io.FlushOutput()
}


#!/usr/bin/env python
"""
This file is part of https://github.com/Cheran-Senthil/PyRival.

Copyright 2018 Cheran Senthilkumar all rights reserved,
Cheran Senthilkumar <hello@cheran.io>
Permission to use, modify, and distribute this software is given under the
terms of the MIT License.

"""
from __future__ import division, print_function

import cmath
import itertools
import math
import operator as op
# import random
import sys
from atexit import register
from bisect import bisect_left, bisect_right
# from collections import Counter, MutableSequence, defaultdict, deque
# from copy import deepcopy
# from decimal import Decimal
# from difflib import SequenceMatcher
# from fractions import Fraction
# from heapq import heappop, heappush

if sys.version_info[0] < 3:
    # from cPickle import dumps
    from io import BytesIO as stream
    # from Queue import PriorityQueue, Queue
else:
    # from functools import reduce
    from io import StringIO as stream
    from math import gcd
    # from pickle import dumps
    # from queue import PriorityQueue, Queue

if sys.version_info[0] < 3:
    class dict(dict):
        """dict() -> new empty dictionary"""
        def items(self):
            """D.items() -> a set-like object providing a view on D's items"""
            return dict.iteritems(self)

        def keys(self):
            """D.keys() -> a set-like object providing a view on D's keys"""
            return dict.iterkeys(self)

        def values(self):
            """D.values() -> an object providing a view on D's values"""
            return dict.itervalues(self)

    def gcd(x, y):
        """gcd(x, y) -> int
        greatest common divisor of x and y
        """
        while y:
            x, y = y, x % y
        return x

    input = raw_input
    range = xrange

    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip

def sync_with_stdio(sync=True):
    """Set whether the standard Python streams are allowed to buffer their I/O.

    Args:
        sync (bool, optional): The new synchronization setting.

    """
    global input, flush

    if sync:
        flush = sys.stdout.flush
    else:
        sys.stdin = stream(sys.stdin.read())
        input = lambda: sys.stdin.readline().rstrip('\r\n')

        sys.stdout = stream()
        register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))

def main():
    n = int(input())
    a = list(map(int, input().split(' ')))

    div_cnt = [0] * (n + 1)
    div_cnt[0] = 1

    res = 0

    max_mod = 1
    for i in a:
        for j in range(max_mod, 0, -1):
            if i % j == 0:
                res += reduce(op.mul, [div_cnt[i] for i in range(j)])
                div_cnt[j] += 1

            if i % max_mod == 0:
                max_mod += 1

        res %= 1000000007

    print(res % 1000000007)

if __name__ == '__main__':
    sync_with_stdio(False)
    main()


#!/usr/bin/env python
"""
This file is part of https://github.com/Cheran-Senthil/PyRival.

Copyright 2018 Cheran Senthilkumar all rights reserved,
Cheran Senthilkumar <hello@cheran.io>
Permission to use, modify, and distribute this software is given under the
terms of the MIT License.

"""
from __future__ import division, print_function

import cmath
import itertools
import math
import operator as op
# import random
import sys
from atexit import register
from bisect import bisect_left, bisect_right
# from collections import Counter, MutableSequence, defaultdict, deque
# from copy import deepcopy
# from decimal import Decimal
# from difflib import SequenceMatcher
# from fractions import Fraction
# from heapq import heappop, heappush

if sys.version_info[0] < 3:
    # from cPickle import dumps
    from io import BytesIO as stream
    # from Queue import PriorityQueue, Queue
else:
    # from functools import reduce
    from io import StringIO as stream
    from math import gcd
    # from pickle import dumps
    # from queue import PriorityQueue, Queue

if sys.version_info[0] < 3:
    class dict(dict):
        """dict() -> new empty dictionary"""
        def items(self):
            """D.items() -> a set-like object providing a view on D's items"""
            return dict.iteritems(self)

        def keys(self):
            """D.keys() -> a set-like object providing a view on D's keys"""
            return dict.iterkeys(self)

        def values(self):
            """D.values() -> an object providing a view on D's values"""
            return dict.itervalues(self)

    def gcd(x, y):
        """gcd(x, y) -> int
        greatest common divisor of x and y
        """
        while y:
            x, y = y, x % y
        return x

    input = raw_input
    range = xrange

    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip

def sync_with_stdio(sync=True):
    """Set whether the standard Python streams are allowed to buffer their I/O.

    Args:
        sync (bool, optional): The new synchronization setting.

    """
    global input, flush

    if sync:
        flush = sys.stdout.flush
    else:
        sys.stdin = stream(sys.stdin.read())
        input = lambda: sys.stdin.readline().rstrip('\r\n')

        sys.stdout = stream()
        register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))

all_factors = lambda n: set(reduce(list.__add__,
                            ([i, n//i] for i in range(1, int(n**0.5) + 1, 2 if n % 2 else 1) if n % i == 0)))

def main():
    n = int(input())
    a = list(map(int, input().split(' ')))

    div_cnt = [0] * (n + 1)
    div_cnt[0] = 1

    res = 0

    for i in a:
        for j in sorted(all_factors(i), reversed=True):
            try:
                res += div_cnt[j - 1]
                if res > 1000000007:
                    res -= 1000000007

                div_cnt[j] += div_cnt[j - 1]
                if div_cnt[j] > 1000000007:
                    div_cnt[j] -= 1000000007
            except:
                pass

    print(res % 1000000007)

if __name__ == '__main__':
    sync_with_stdio(False)
    main()


#!/usr/bin/env python
"""
This file is part of https://github.com/Cheran-Senthil/PyRival.

Copyright 2018 Cheran Senthilkumar all rights reserved,
Cheran Senthilkumar <hello@cheran.io>
Permission to use, modify, and distribute this software is given under the
terms of the MIT License.

"""
from __future__ import division, print_function

import cmath
import itertools
import math
import operator as op
# import random
import sys
from atexit import register
from bisect import bisect_left, bisect_right
# from collections import Counter, MutableSequence, defaultdict, deque
# from copy import deepcopy
# from decimal import Decimal
# from difflib import SequenceMatcher
# from fractions import Fraction
# from heapq import heappop, heappush

if sys.version_info[0] < 3:
    # from cPickle import dumps
    from io import BytesIO as stream
    # from Queue import PriorityQueue, Queue
else:
    # from functools import reduce
    from io import StringIO as stream
    from math import gcd
    # from pickle import dumps
    # from queue import PriorityQueue, Queue

if sys.version_info[0] < 3:
    class dict(dict):
        """dict() -> new empty dictionary"""
        def items(self):
            """D.items() -> a set-like object providing a view on D's items"""
            return dict.iteritems(self)

        def keys(self):
            """D.keys() -> a set-like object providing a view on D's keys"""
            return dict.iterkeys(self)

        def values(self):
            """D.values() -> an object providing a view on D's values"""
            return dict.itervalues(self)

    def gcd(x, y):
        """gcd(x, y) -> int
        greatest common divisor of x and y
        """
        while y:
            x, y = y, x % y
        return x

    input = raw_input
    range = xrange

    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip

def sync_with_stdio(sync=True):
    """Set whether the standard Python streams are allowed to buffer their I/O.

    Args:
        sync (bool, optional): The new synchronization setting.

    """
    global input, flush

    if sync:
        flush = sys.stdout.flush
    else:
        sys.stdin = stream(sys.stdin.read())
        input = lambda: sys.stdin.readline().rstrip('\r\n')

        sys.stdout = stream()
        register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))

def main():
    n = int(input())
    a = list(map(int, input().split(' ')))

    div_cnt = [0] * (n + 1)
    div_cnt[0] = 1

    res = 0

    max_mod = 1
    for i in a:
        for j in range(max_mod, 0, -1):
            if i % j == 0:
                res += div_cnt[j - 1]
                div_cnt[j] += div_cnt[j - 1]

            if i % max_mod == 0:
                max_mod += 1

        res %= 1000000007

    print(res % 1000000007)

if __name__ == '__main__':
    sync_with_stdio(False)
    main()


#!/usr/bin/env python
"""
This file is part of https://github.com/Cheran-Senthil/PyRival.

Copyright 2018 Cheran Senthilkumar all rights reserved,
Cheran Senthilkumar <hello@cheran.io>
Permission to use, modify, and distribute this software is given under the
terms of the MIT License.

"""
from __future__ import division, print_function

import cmath
import itertools
import math
import operator as op
# import random
import sys
from atexit import register
from bisect import bisect_left, bisect_right
# from collections import Counter, MutableSequence, defaultdict, deque
# from copy import deepcopy
# from decimal import Decimal
# from difflib import SequenceMatcher
# from fractions import Fraction
# from heapq import heappop, heappush

if sys.version_info[0] < 3:
    # from cPickle import dumps
    from io import BytesIO as stream
    # from Queue import PriorityQueue, Queue
else:
    # from functools import reduce
    from io import StringIO as stream
    from math import gcd
    # from pickle import dumps
    # from queue import PriorityQueue, Queue

if sys.version_info[0] < 3:
    class dict(dict):
        """dict() -> new empty dictionary"""
        def items(self):
            """D.items() -> a set-like object providing a view on D's items"""
            return dict.iteritems(self)

        def keys(self):
            """D.keys() -> a set-like object providing a view on D's keys"""
            return dict.iterkeys(self)

        def values(self):
            """D.values() -> an object providing a view on D's values"""
            return dict.itervalues(self)

    def gcd(x, y):
        """gcd(x, y) -> int
        greatest common divisor of x and y
        """
        while y:
            x, y = y, x % y
        return x

    input = raw_input
    range = xrange

    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip

def sync_with_stdio(sync=True):
    """Set whether the standard Python streams are allowed to buffer their I/O.

    Args:
        sync (bool, optional): The new synchronization setting.

    """
    global input, flush

    if sync:
        flush = sys.stdout.flush
    else:
        sys.stdin = stream(sys.stdin.read())
        input = lambda: sys.stdin.readline().rstrip('\r\n')

        sys.stdout = stream()
        register(lambda: sys.__stdout__.write(sys.stdout.getvalue()))

all_factors = lambda n: set(reduce(list.__add__,
                            ([i, n//i] for i in range(1, int(n**0.5) + 1, 2 if n % 2 else 1) if n % i == 0)))

def main():
    n = int(input())
    a = list(map(int, input().split(' ')))

    div_cnt = [0] * (n + 1)
    div_cnt[0] = 1

    res = 0

    for i in a:
        for j in sorted(all_factors(i), reverse=True):
            try:
                res += div_cnt[j - 1]
                if res > 1000000007:
                    res -= 1000000007

                div_cnt[j] += div_cnt[j - 1]
                if div_cnt[j] > 1000000007:
                    div_cnt[j] -= 1000000007
            except:
                pass

    print(res)

if __name__ == '__main__':
    sync_with_stdio(False)
    main()