import java.util.*;
public class CF383D{
final int MOD = 1000000007;
final int BASE = 10010;
int[] a = new int[1111];
int n,sum=0;
int[][] dp = new int[1111][21111];
CF383D(){
Scanner in = new Scanner(System.in);
n=in.nextInt();
for(int i=1;i<=n;i++){
a[i]=in.nextInt();
sum+=a[i];
}
dp[0][BASE]=1;
for(int i=1;i<=n;i++)
{
dp[i][BASE]=1;
for(int j=-sum;j<=sum;j++)
{
if(dp[i-1][j+BASE]!=0)
{
dp[i][j+BASE+a[i]]+=dp[i-1][j+BASE];
dp[i][j+BASE+a[i]]%=MOD;
dp[i][j+BASE-a[i]]+=dp[i-1][j+BASE];
dp[i][j+BASE-a[i]]%=MOD;
}
}
}
int ans=0;
for(int i=1;i<=n;i++)
{
ans+=dp[i][BASE]-1;
ans%=MOD;
}
System.out.println(ans);
}
public static void main(String[] args){
new CF383D();
}
}