#include<cstdio>
const int MOD=1e9+7;
struct mint{int x;mint(int x=0):x(x){}};
inline mint operator+  (mint a,mint b){return a.x+b.x<MOD?a.x+b.x:a.x+b.x-MOD;}
inline mint operator-  (mint a){return MOD-a.x;}
inline mint operator-  (mint a,mint b){return a+-b;}
inline mint operator*  (mint a,mint b){return 1LL*a.x*b.x%MOD;}
inline mint operator<< (mint x,int y){mint r=1;for(;y;y>>=1,x=x*x)if(y&1)r=r*x;return r;}
inline mint operator~  (mint x){return x<<MOD-2;}
inline mint operator/  (mint a,mint b){return a*~b;}
inline mint&operator+= (mint&a,mint b){return a=a+b;}
inline mint&operator-= (mint&a,mint b){return a=a-b;}
inline mint&operator*= (mint&a,mint b){return a=a*b;}
inline mint&operator<<=(mint&x,int y){return x=x<<y;}
inline mint&operator/= (mint&a,mint b){return a=a/b;}
#define MN 2000000
int x1[2],y1[2],x2[2],y2[2],xl,xr,yl,yr;
mint ans,f[MN+5],rf[MN+5];
inline mint F(int n,int m){return f[n+m]*rf[n]*rf[m];}
struct P{int x,y;P(int x,int y):x(x),y(y){}};
inline mint F(const P&a,const P&b){return F(b.x-a.x,b.y-a.y);}
mint cal(int x1,int y1,int x2,int y2)
{
	P s(x1,y1),t(x2,y2),l(xl,yl),r(xr,yr);
	mint res=F(s,r)*F(r,t)*(xr+yr+1)-F(s,l)*F(l,t)*(xl+yl);int i;
	for(i=yl;++i<=yr;)res-=F(s,P(xl-1,i))*F(P(xl,i),t)*(xl+i);
	for(i=xl;++i<=xr;)res-=F(s,P(i,yl-1))*F(P(i,yl),t)*(i+yl);
	for(i=yl;i<yr;++i)res+=F(s,P(xr,i))*F(P(xr+1,i),t)*(xr+i+1);
	for(i=xl;i<xr;++i)res+=F(s,P(i,yr))*F(P(i,yr+1),t)*(i+yr+1);
	return res;
}
int main()
{
	int i;
	for(f[0]=i=1;i<=MN;++i)f[i]=f[i-1]*i;
	for(rf[i=MN]=~f[MN];i--;)rf[i]=rf[i+1]*(i+1);
	scanf("%d%d%d%d%d%d",&x1[0],&x1[1],&xl,&xr,&x2[1],&x2[0]);
	scanf("%d%d%d%d%d%d",&y1[0],&y1[1],&yl,&yr,&y2[1],&y2[0]);
	#define rep(i) for(int i=0;i<2;++i)
	rep(a)rep(b)rep(c)rep(d)ans+=cal(x1[a]-!a,y1[b]-!b,x2[c]+!c,y2[d]+!d)*(a^b^c^d?MOD-1:1);
	printf("%d",ans);
}