#include<cstdio>
#include<cstring>
#include<algorithm>
#define SF scanf
#define PF printf
#define MAXN 2000010
#define MOD 1000000007
using namespace std;
typedef long long ll;
int x1,x2,x3,x4,x5,x6,y1,y2,y3,y4,y5,y6;
int f[4][4];
int g[4][4];
ll fac[MAXN],ifac[MAXN];
ll ans;
ll fsp(ll x,int y){
	ll res=1;
	while(y){
		if(y&1)
			res=res*x%MOD;
		x=x*x%MOD;
		y>>=1;
	}
	return res;
}
ll C(int n,int m){
	return fac[n+m]*ifac[m]%MOD*ifac[n]%MOD;	
}
ll cal(int tag1,ll xl,ll yl,int tag2,ll xr,ll yr){
	ll res=0;
	for(ll i=x3;i<=x4;i++){
		res=(res-C(i-xl,y3-1-yl)*(i+y3)%MOD*C(xr-i,yr-y3))%MOD;
		res=(res+C(xr-i,yr-y4-1)*(i+y4+1)%MOD*C(i-xl,y4-yl))%MOD;	
	}
	for(ll i=y3;i<=y4;i++){
		res=(res-C(i-yl,x3-1-xl)*(i+x3)%MOD*C(yr-i,xr-x3))%MOD;
		res=(res+C(yr-i,xr-x4-1)*(i+x4+1)%MOD*C(i-yl,x4-xl))%MOD;	
	}
	return res*tag1*tag2;
	
}
int main(){
	fac[0]=1;
	for(int i=1;i<=2000000;i++)
		fac[i]=fac[i-1]*i%MOD;
	ifac[2000000]=fsp(fac[2000000],MOD-2);
	for(int i=2000000;i>=1;i--)
		ifac[i-1]=ifac[i]*i%MOD;
	SF("%d%d%d%d%d%d",&x1,&x2,&x3,&x4,&x5,&x6);
	SF("%d%d%d%d%d%d",&y1,&y2,&y3,&y4,&y5,&y6);
	f[0][0]=1,f[0][1]=x1-1,f[0][2]=y1-1;
	f[1][0]=-1,f[1][1]=x1-1,f[1][2]=y2;
	f[2][0]=-1,f[2][1]=x2,f[2][2]=y1-1;
	f[3][0]=1,f[3][1]=x2,f[3][2]=y2;
	g[0][0]=1,g[0][1]=x6+1,g[0][2]=y6+1;
	g[1][0]=-1,g[1][1]=x6+1,g[1][2]=y5;
	g[2][0]=-1,g[2][1]=x5,g[2][2]=y6+1;
	g[3][0]=1,g[3][1]=x5,g[3][2]=y5;
	for(int i=0;i<4;i++)
		for(int j=0;j<4;j++)
			ans=(ans+cal(f[i][0],f[i][1],f[i][2],g[j][0],g[j][1],g[j][2]))%MOD;
	PF("%lld",(ans+MOD)%MOD);
}	