An integer sequence a is rebound sequence if there are three integers i, j, k (1≤i<j<k≤N) satisfying a_i>a_k>a_j. You are given an integer sequence s. Your task is to count the number of rebound sequences that can be obtained by permuting the elements of s.
The input consists of a single test case in the format below.
N
s_1 s_2 … s_N
The first line contains a single integer N (1≤N≤200). The second line contains N integers s_i (1≤s_i≤N), which is the i-th element of s.
Output the number of rebound sequences that can be obtained by permuting the elements of s modulo 109+7.