#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
const long long INF = 1e9;
const long long IINF = 1e18;
const double EPS = 1e-8;
const double pi = acos(-1);
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
long long gcd(long long x, long long y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  long long cnt = -1, ans = INF;
  for (long long i = 0; i < (N); ++i) {
    long long a;
    cin >> a;
    if (cnt == -1)
      cnt = a;
    else
      cnt = gcd(cnt, a);
    chmin(ans, a);
  }
  for (long long i = (2); i < (N); ++i)
    if (cnt % i == 0) ans = ans * i % MOD, cnt /= i;
  cout << ans << endl;
}
