#include<cstdio>
const int N=100010,p=9999997;
typedef long long ll;
int n,m,a[N],c[N];bool vis[N];
ll ans,sum;
ll mi(ll x,ll y){
ll ans=1;
for (;y;x=(x*x)%p,y>>=1)
if (y&1) ans=(ans*x)%p;
return ans;
}
inline int MK()
{
freopen("Marshtomp.in","r",stdin);
freopen("Marshtomp.out","w",stdout);
scanf("%d",&n);
for (int i=1;i<=n;i++) scanf("%d",&a[i]);
scanf("%d",&m);
for (int i=1;i<=m;i++)
scanf("%d",&c[i]),vis[c[i]]=1;
ans=1;
for (int i=1;i<=n;i++)
if (vis[i]) ans=(ans+a[i])%p;
for (int i=1;i<=n;i++)
if (!vis[i]) ans=ans*(a[i]+1)%p;
printf("%lld\n",ans-1);
return 0;
}
int aa=MK();
int main()
{
;
}