#include<iostream>
#include<unordered_map>
using namespace std;
int n, x;
int mod = 1e9 + 7;
long long res = 1;
int main() {
cin >> n;
unordered_map<int, int> h;
//算质因子及其指数
while (n -- ) {
cin >> x;
for (int i = 2; i <= x / i; i ++ ) {
while (x % i == 0) {
h[i] ++ ;
x /= i;
}
}
if (x > 1) h[x] ++ ;
}
//算和
for (auto p : h) {
long long a = p.first, b = p.second;
long long t = 1;
while (b -- ) {
t = (t * a + 1) % mod;
}
res = res * t % mod;
}
cout << res << endl;
}