import std.algorithm; import std.array; import std.conv; import std.math; import std.range; import std.stdio; import std.string; import std.typecons; int readint() { return readln.chomp.to!int; } int[] readints() { return readln.split.map!(to!int).array; } long calc(int[] xs) { const MOD = 1_000_000_007; long[101] sum; foreach (x; xs) sum[x]++; long ans = 0; for (int i = 1; i <= 100; i++) { for (int j = i + 1; j <= 100; j++) { for (int k = j + 1; k <= 100; k++) { ans = (ans + sum[i] * sum[j] * sum[k]) % MOD; } } } return ans; } void main() { readln; auto xs = readints; writeln(calc(xs)); }