#include<bits/stdc++.h>
using namespace std;
#define ll long long int
ll dp[100009][2];
vector<ll>vec;
ll M;
ll n;
ll call(ll pos,ll pev)
{
    if(pos==0)
    {
        return 1;
    }
    if(dp[pos][pev]!=-1)
    {
        return dp[pos][pev];
    }
    ll x,y;
    if(pev==0)
    {
        x=call(pos-1,0);
        y=call(pos-1,1);
        x=(x+y)%M;
    }
    else
    {
        x=call(pos-1,0);
        x=x%M;
    }

    return dp[pos][pev]=x;
}
int main()
{
    ll a,b,c,d,e,i,j,k,l,m,x,y,t,p;
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>a;
        vec.push_back(a);
    }
    m=M=(1e9)+7;
    memset(dp,-1,sizeof(dp));
    for(i=n;i>=0;i--)
    {
        x=call(i,0);
        x=call(i,1);
    }
    dp[0][0]=dp[0][1]=1;
    if(n==1)
    {
        cout<<vec[0]<<endl;
        return 0;
    }
    if(n==2)
    {
        x=(vec[0]*2);
        cout<<x<<endl;
        return 0;
    }
    ll ans=0;
    x=(dp[n-1][0]*vec[0])%M;
    ans=x;
    for(i=1;i<n;i++)
    {
        a=dp[i-1][0];
        b=dp[(n-1)-i][0];
        //cout<<a<<" "<<b<<endl;
        b=(a*b)%M;
        b=(b*vec[i])%M;
        a=dp[i-1][1];
        c=dp[(n-1)-i][1];
        //cout<<a<<"  "<<c<<endl;
        c=(c*a)%M;
        c=(c*vec[i])%M;
        b=(b-c)%M;
        b=(b+M)%M;
        ans=(ans+b)%M;
    }

    cout<<ans<<endl;
}

/*
 * Author - Abhas Jain
 * Code is inside the solve function
 */
 
#include <bits/stdc++.h>
 
#define F first
#define S second
#define all(c) c.begin(), c.end()
#define endl '\n'
#define pb push_back

typedef long long ll;
typedef long double ld;

using namespace std;
mt19937 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
 
const ld PI = 3.141592653589793;
const ll INF = 9223372036854775807ll;
const ll mod = 1e9 + 7;

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }
    
    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

void solve() 
{
    int n;
    cin >> n;
    unordered_map<int, int, custom_hash> mp;
    int mn = 1e9 + 2;
    for (int i = 0; i < n; ++i) {
        int cur;
        cin >> cur;
        mn = min(cur, mn);
        for (int j = 1; j * j <= cur; ++j) {
            if (cur % j == 0) {
                mp[j] = __gcd(mp[j], cur);
                mp[cur / j] = __gcd(mp[cur / j], cur);
            }
        }
    }
    int ans = 0;
    for (auto div : mp) {
        if (div.S == div.F && div.S <= mn) {
            ans++;
        }
    }
    cout << ans << endl;
}
 
int main( )
{   
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    solve();
    return 0;
}