#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long INF = mod * mod;
const double eps = 1e-8;
const double pi = acos(-1.0);
const int mn = 100001;
bool isp[mn];
vector<int> c[mn];
vector<pair<int, int> > p[mn];
void init() {
  fill(isp + 2, isp + mn, true);
  for (int i = 2; i < mn; i++) {
    if (!isp[i]) continue;
    c[i].push_back(i);
    for (int j = 2 * i; j < mn; j += i) {
      c[j].push_back(i);
      isp[j] = false;
    }
  }
  for (int i = 2; i < mn; i++) {
    int cop = i;
    for (int j = 0; j < c[i].size(); j++) {
      int tmp = 0;
      int d = c[i][j];
      while (cop % d == 0) {
        tmp++;
        cop /= d;
      }
      p[i].push_back({d, tmp});
    }
  }
}
int ma[1 << 17];
int gcd(int a, int b) {
  if (a < b) swap(a, b);
  while (b) {
    int r = a % b;
    a = b;
    b = r;
  }
  return a;
}
long long mod_pow(long long a, long long n = mod - 2, long long m = mod) {
  long long ret = 1;
  while (n) {
    if (n % 2) ret = ret * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return ret;
}
void solve() {
  init();
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  cout << a[0] << endl;
  return;
  for (int i = 1; i <= n - 1; i++) {
    int g = i;
    int u = gcd(g, n - i);
    g /= u;
    u = gcd(g, a[i]);
    g /= u;
    for (int j = 0; j < p[g].size(); j++) {
      ma[p[g][j].first] = max(ma[p[g][j].first], p[g][j].second);
    }
  }
  long long ans = a[0];
  for (int i = 1; i <= n - 1; i++) {
    ans = ans * i % mod;
  }
  for (int i = 2; i < mn; i++) {
    long long inv = mod_pow(i);
    for (int j = 0; j < ma[i]; j++) {
      ans = ans * inv % mod;
    }
  }
  cout << ans << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
