You are given an array of integers, . Find the sum of all of its subsequence sums modulo .
The first line contains an integer, .
The next line contains space-separated integers, .
Output the sum of all subsequence sums modulo .
3 1 2 3
Explanation for Sample
The subsequence sums are
The sum of all subsequence sums is .