#include <bits/stdc++.h>
using namespace std;
using ld = long double;
using ll = long long int;
const ll INF = (ll)1e9 + 10;
const ll INFLL = (ll)1e18 + 10;
const ll MOD = 998244353;
template <class T>
T& chmin(T& a, const T& b) {
  return a = min(a, b);
}
template <class T>
T& chmax(T& a, const T& b) {
  return a = max(a, b);
}
template <class T>
void UNIQUE(vector<T>& a) {
  a.erase(unique(a.begin(), a.end()), a.end());
}
template <class S, class T>
ostream& operator<<(ostream& os, const pair<S, T> v) {
  os << "(" << v.first << ", " << v.second << ")";
  return os;
}
template <class T>
ostream& operator<<(ostream& os, const vector<T> v) {
  for (int i = 0; i < v.size(); i++) {
    if (i > 0) {
      os << " ";
    }
    os << v[i];
  }
  return os;
}
template <class T>
ostream& operator<<(ostream& os, const vector<vector<T>> v) {
  for (int i = 0; i < v.size(); i++) {
    if (i > 0) {
      os << endl;
    }
    os << v[i];
  }
  return os;
}
ll in() {
  long long int x;
  scanf("%lld", &x);
  return x;
}
ld fin() {
  double x;
  scanf("%lf", &x);
  return x;
}
char yuyushiki[1000010];
string stin() {
  scanf("%s", yuyushiki);
  return yuyushiki;
}
vector<int> v, s;
vector<bool> used;
void dfs(int x) {
  used[x] = true;
  s.emplace_back(x);
  if (!used[v[x]]) {
    dfs(v[x]);
  }
}
const ll N = 100010;
int main() {
  vector<ll> ps(0);
  vector<bool> isp(N, true);
  isp[0] = isp[1] = false;
  for (ll i = (2); i < (ll)(N); i++) {
    if (isp[i]) {
      ps.emplace_back(i);
      for (ll j = i * 2; j < N; j += i) {
        isp[j] = false;
      }
    }
  }
  ll n = in();
  vector<ll> b(n);
  for (ll i = (0); i < (ll)(n); i++) {
    b[i] = in();
  }
  ll res = b[0] % MOD;
  for (auto& w : ps) {
    ll cur = w;
    ll cnt = 0;
    while (cur <= n - 1) {
      cnt += (n - 1) / cur;
      cur *= w;
    }
    for (ll i = w; i < n; i += w) {
      ll j = 0;
      cur = b[i];
      while (cur % w == 0) {
        cur /= w;
        j++;
      }
      cur = i;
      while (cur % w == 0) {
        cur /= w;
        j--;
      }
      if (j < 0) {
        cnt += j;
      }
    }
    for (ll i = (0); i < (ll)(cnt); i++) {
      res *= w;
      res %= MOD;
    }
  }
  cout << res << endl;
  return 0;
}
