#t276. 拼木棒

拼木棒

Background

Special for beginners, ^_^

Form an Equilateral Triangle from Sticks

Problem Description

There are nn sticks. Now choose 44 of them to form an equilateral triangle. In how many ways can this be done?

The answer should be taken modulo 109+710^9+7.

Input Format

The first line contains one integer nn.

The next nn lines each contain one integer; the ii-th integer aia_i is the length of the ii-th stick.

Output Format

One line containing one integer: the answer.

Sample Input

4
1
1
2
2

Sample Output

1

Constraints

1s, 1024KiB for each test case.

  • For 30%30\% of the data, n≤5×103n \le 5 \times 10^3.
  • For 100%100\% of the data, 1≤n≤1051 \le n \le 10^5 and 1≤ai≤1041 \le a_i \le 10^4.