M_{i, j} = left{begin{matrix} x + a_i b_j & mathrm{when} i = j \ a_i b_j & mathrm{otherwise} end{matrix}right.
Bobo has an integer x and two n arrays a_1, dots, a_n a 1 ,…,a n , b_1, dots, b_n b 1 ,…,b n . He makes an n times n n×n matrix M where M_{i, j} = left{begin{matrix} x + a_i b_j & mathrm{when} i = j \ a_i b_j & mathrm{otherwise} end{matrix}right. M i,j ={ x+a i b j a i b j when i=j otherwise Find the determinant of the matrix M modulo (10^9+7) (10 9 +7).

(图片来源网络,侵删)