I don’t see any problem with my code but still getting error, Please tell me if there is any mistake in the code.
/**
*
-
@author Archit
/
import java.util.;
public class main {
public static long mod = 1000000007;public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long x = 1;
long[] a = new long[n];
for(int i =0;i<n;i++){
a[i] = sc.nextLong();
x = (x*(a[i]+1)+mod)%mod;
}
x/=2;
long ans = 1;
for(int i =0;i<n;i++){
ans = (ans*((x*a[i]+mod)%mod+1)+mod)%mod;
}
System.out.println(ans%mod);
}
}