Product of differences#9889

Product of differences

1 second
128 megabytes
Easy

Array of integers a_1, a_2, \ldots, a_n is given. Find the product

\prod_{\substack{1 \le i < j \le n}}|a_i − a_j|

If you are not familiar with short notation, this product equals to

|a_1 − a_2| \times |a_1 − a_3| \times \ldots \times |a_1 − a_n| \times |a_2 − a_3| \times |a_2 − a_4| \times \ldots \times |a_2 − a_n| \times \ldots \times |a_{n−1} − a_n|

In other words, this is the product of |a_i − a_j| for all 1 \le i < j \le n.

As the result will be very big, find it modulo .

Input

First line contains two integers n\:(n \le 10^5) and m\:(m \le 1000). Next line contains integers a_1, a_2, \ldots, a_n\:(0 \le a_i \le 10^9).

Output

Print the value of the product modulo .

Examples

Example 1

Loading
Loading