You are given an array of $n$ integers. Your task is to count the number of ways to split the array into continuous segments such that all segments consists of distinct values.
The first line has an integers $n$ : the size of the array.
The next line has $n$ integers $x_1, x_2,\dots, x_n$ : the contents of the array.
Print one integer: the answer to the problem modulo $10^9 + 7$ .
4 1 2 1 3
\n · · · \n
6
\n