You're given an array $$$a_0, a_1, \dots, a_{2^n-1}$$$.
Consider a $$$2^n \times 2^n$$$ matrix $$$A$$$ such that $$$A_{ij} = a_{i | j}$$$, where $$$i | j$$$ is the bitwise OR of the numbers $$$i$$$ and $$$j$$$.
Find the determinant of $$$A$$$.
The first line of input contains a single integer $$$n$$$ ($$$1 \leq n \leq 20$$$).
The second line of input contains $$$2^n$$$ integers $$$a_0, a_1, \dots, a_{2^n-1}$$$ ($$$0 \le a_i \lt 10^9 + 9$$$).
Print a single integer, the determinant of $$$A$$$ modulo $$$10^9+9$$$.
1 5 2
6
2 3 1 5 4
999999997
3 53 37 42 42 84 37 66 8
47229676
In the first example, the determinant is $$$$$$ \begin{vmatrix} a_0 & a_1 \\ a_1 & a_1 \end{vmatrix} = \begin{vmatrix} 5 & 2 \\ 2 & 2 \end{vmatrix} = 10 - 4 = 6. $$$$$$
In the second example, the determinant is $$$$$$ \begin{vmatrix} 3 & 1 & 5 & 4 \\ 1 & 1 & 4 & 4 \\ 5 & 4 & 5 & 4 \\ 4 & 4 & 4 & 4 \end{vmatrix} = -12 \equiv 999999997 \pmod{10^9 + 9}. $$$$$$