ll@N,@A--[N],cnt[30] = {}; rep(i,N)cnt[A[i]]++; ll ans=1; rep(i,N)ans*=i+1; rep(i,N)rep(j,cnt[i])ans/=j+1; wt(ans);