Just try to think mathematically and you will get it
#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define mod 1000000007
int exp(int x,int y){int res=1;x=x%mod;while(y>0){if(y&1)res=(res*x)%mod;y=y>>1;x=(x*x)%mod;}return res;}
int mul(int a,int b){a%=mod,b%=mod;a=((a*b)%mod+mod)%mod;return a;}
signed main()
{
int n;
cin >> n;
int neg = 0, pos = 0;
for (int i = 0; i < n; i++)
{
int x;
cin >> x;
if (x < 0)
neg++;
else if (x > 0)
pos++;
}
if (neg == 0)
{
cout << 0;
}
else
{
int ans = mul(exp(2, neg - 1), exp(2, pos));
cout << ans;
}
}