ll N,A[1d5],d[101],x; { rd(N,A(N)); ++d[A[0..N-1]]; rep(i,99)rep(j,i+1,100)rep(k,j+1,101){ x+=d[i]*d[j]*d[k]; } wt(x%=1d9+7); }