#include using namespace std; int main(){ int n,x; cin >> n; vector t(100); for(int i = 0; i < n; i++){ cin >> x; t[--x]++; } long long ans = 0; for(int i = 0; i < 100; i++){ for(int j = 0; j < i; j++){ for(int k = 0; k < j; k++){ ans += t[i] * t[j] * t[k]; } } } cout << ans % 1000000007 << '\n'; }