#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
#define mp make_pair
#define pii pair<int,int>
#define fi first
#define se second
const int N=2e6+100,mod=1e9+7;
int X[7],Y[7];
LL fac[N],inv[N],Ans;

LL C(int x,int y) {return fac[x]*inv[y]%mod*inv[x-y]%mod;}
LL Go(pii st,pii ed) {return C(ed.fi-st.fi+ed.se-st.se,ed.fi-st.fi);}
LL qpow(LL x,int y)
{
	LL ret=1;
	while(y)
	{
		if(y&1) ret=ret*x%mod;
		x=x*x%mod, y>>=1;
	}
	return ret;
}
LL calc(pii st, pii ed)
{
	LL ret=0;
	for(int i=Y[3];i<=Y[4];++i)
		(ret+=Go(st,mp(X[4],i))*(i+X[4]+1)%mod*Go(mp(X[4]+1,i),ed)%mod)%=mod;
	for(int i=X[3];i<=X[4];++i)
		(ret+=Go(st,mp(i,Y[4]))*(i+Y[4]+1)%mod*Go(mp(i,Y[4]+1),ed)%mod)%=mod;
	for(int i=Y[3];i<=Y[4];++i)
		(ret-=Go(st,mp(X[3]-1,i))*(i+X[3])%mod*Go(mp(X[3],i),ed)%mod)%=mod;
	for(int i=X[3];i<=X[4];++i)
		(ret-=Go(st,mp(i,Y[3]-1))*(i+Y[3])%mod*Go(mp(i,Y[3]),ed)%mod)%=mod;
	//cout<<ret<<endl;
	return ret;
}

int main()
{
	for(int i=1;i<=6;++i) scanf("%d",&X[i]);
	for(int i=1;i<=6;++i) scanf("%d",&Y[i]);
	fac[0]=1;
	for(int i=1;i<N;++i) fac[i]=fac[i-1]*i%mod;
	inv[N-1]=qpow(fac[N-1],mod-2);
	for(int i=N-2;i>=0;--i) inv[i]=inv[i+1]*(i+1)%mod;
	++X[6], ++Y[6], --X[1], --Y[1];
	pii st[4],ed[4];
	st[0]=mp(X[1],Y[1]), st[1]=mp(X[1],Y[2]), st[2]=mp(X[2],Y[2]), st[3]=mp(X[2],Y[1]);
	ed[0]=mp(X[5],Y[5]), ed[1]=mp(X[5],Y[6]), ed[2]=mp(X[6],Y[6]), ed[3]=mp(X[6],Y[5]);
	for(int i=0;i<4;++i)
		for(int j=0;j<4;++j)
			if((i&1) == (j&1)) (Ans+=calc(st[i],ed[j]))%=mod;
			else (Ans-=calc(st[i],ed[j]))%=mod;
	Ans%=mod, Ans+=mod, Ans%=mod;
	printf("%lld",Ans);
	return 0;
}