#include using namespace std; #define rep(i,n) for(int i=0;i=0;i--) #define fi first #define se second #define pb push_back #define sz(a) (int)a.size() #define vec(...) vector<__VA_ARGS__> #define _3rfKJyA ios::sync_with_stdio(0),cin.tie(0) typedef long long ll; using pii=pair; using vi=vector; void print(){cout<<'\n';} template void print(const h&v,const t&...u){cout<>n; vi cnt(n+1,0); rep(i,n){ int x;cin>>x; cnt[x]+=1; } ll ans=1; for(ll i=1;i<=n;i++){ ans*=i; } rng(i,1,n+1){ ll e=1; rep(j,cnt[i]){ e*=(j+1); } ans/=e; } cout<