Random XOR

아직 제출이 없습니다시간 제한1초메모리 제한256 MB

문제

There is an array aa containing nn integers. Also, there is initially empty array bb. Some elements of aa are going to be added to bb. Each element is added with probability PP independently from others. Then the value of ss is to be computed: s=_i=0bb_is = \oplus\_{i = 0}^{|b|} b\_{i} where \oplus is bitwise exclusive OR (if the array bb is empty, ss equals to zero). You are required to compute the expected value of s2s^{2}.

입력

The first line of input contains three integers nn, XX and YY. The probability PP is equal to XY\frac{X}{Y}.

The second line contains nn integers a_ia\_{i} divided by spaces --- elements of the array aa.

출력

The answer can be always represented as a fraction uv\frac{u}{v} where uu and vv are co-prime numbers and v0mod(109+7)v \neq 0 \mod (10^9+7) You are required to output only one number --- u×v1mod(109+7)u \times v^{-1} \mod (10^9+7)

제한

  • 1n1051 \le n \le 10^5
  • 0X<109+70 \le X < 10^9+7
  • 0<Y<109+70 < Y < 10^9+7
  • XYX \le Y
  • 0a_i<109+70 \le a\_i < 10^9+7