#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long int lcm(long long int a, long long int b) {
  return (a * b) / gcd(a, b);
}
int main() {
  long long int a[3000], n;
  long long int multi = 1;
  long long int sum = 0;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (long long int i = 0; i < n; i++) {
    multi = lcm(multi, a[i]);
  }
  multi -= 1;
  for (int i = 0; i < n; i++) {
    sum += multi % a[i];
    sum %= long long int(pow(10, 9) + 7);
  }
  cout << sum << endl;
  return 0;
}
