Problem: Creatnx has mirrors, numbered from to . Every day, Creatnx asks exactly one mirror "Am I beautiful?". The -th mirror will tell Creatnx that he is beautiful with probability for all .
Creatnx asks the mirrors one by one, starting from the -st mirror. Every day, if he asks -th mirror, there are two possibilities:
- The -th mirror tells Creatnx that he is beautiful. In this case, if Creatnx will stop and become happy, otherwise he will continue asking the -th mirror next day;
- In the other case, Creatnx will feel upset. The next day, Creatnx will start asking from the -st mirror again.
You need to calculate the expected number of days until Creatnx becomes happy.
This number should be found by modulo . Formally, let . It can be shown that the answer can be expressed as an irreducible fraction , where and are integers and . Output the integer equal to . In other words, output such an integer that and .
Input Format: The first line contains one integer () — the number of mirrors.
The second line contains integers ().
Output Format: Print the answer modulo in a single line.
Note: In the first test, there is only one mirror and it tells, that Creatnx is beautiful with probability . So, the expected number of days until Creatnx becomes happy is .