#include using namespace std; typedef long long ll; typedef long double ld; #define REP(i, n) for (int i = 0; i < (n); ++i) #define REPR(i, n) for (int i = n - 1; i >= 0; --i) #define FOR(i, m, n) for (int i = m; i < n; ++i) #define FORR(i, m, n) for (int i = m; i >= n; --i) #define ALL(v) (v).begin(),(v).end() templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b a){ bool u=false; if(a[0]a[2]&&a[0]!=a[2]) u=true; if(a[0]>a[1]&&a[1]> n; vector c(100); REP(i,n){ int a;cin >> a; c[a-1]++; } ll ans=0; REP(i,100) FOR(j,i+1,100) FOR(k,j+1,100) (ans+=c[i]*c[j]*c[k])%=mod; cout << ans << endl; }