Vovochka
You are given an array of integers .
Vovochka divided all the elements of this array into triplets, calculated the median for each triple, and put the obtained numbers in the sorted order in the array .
For example, the array could be split into triplets and . In this case, the median array would be .
Another way to split into triples is , then the array of medians would be .
How many distinct arrays could Vovochka get? Since this number can be very large, print it modulo .
As a reminder, the median of three numbers is defined as follows: let be these three numbers in sorted order, then the median is the number .
Вхідні дані
The first line contains a single integer ().
The second line contains integers () — elements of the array.
Вихідні дані
Print a single integer — the number of possible arrays , modulo .
Приклади
Примітка
In the first example, will always be equal to .
In the second example, arrays are possible: .