#include<bits/stdc++.h>
#define L long long
#define vi vector<int>
#define pb push_back
#define pi pair<int,int>
#define pii pair<pi,int>
#define aa first
#define bb second
#define xx aa.aa
#define yy aa.bb
#define zz bb
#define mp make_pair
#define mpp(a,b,c) mp(mp(a,b),c)
using namespace std;
const int q=1000000007;
int x[10],y[10],a[2000010],b[2000010],p;
inline int C(int n,int m)
{
	if(m<0 || m>n)
	  return 0;
	else
	  return (L)a[n]*b[m]%q*b[n-m]%q;
}
inline int orz(int x1,int y1,int x2,int y2)
{
	return C(x2-x1+y2-y1,x2-x1);
}
inline void calc(int i,int j,int ii,int jj,int k)
{
	int l=0,r=0;
	l=(l+orz(x[1]-1,y[1]-1,i,j))%q;
	l=(l-orz(x[1]-1,y[2],i,j))%q;
	l=(l-orz(x[2],y[1]-1,i,j))%q;
	l=(l+orz(x[2],y[2],i,j))%q;
	r=(r+orz(ii,jj,x[6]+1,y[6]+1))%q;
	r=(r-orz(ii,jj,x[5],y[6]+1))%q;
	r=(r-orz(ii,jj,x[6]+1,y[5]))%q;
	r=(r+orz(ii,jj,x[5],y[5]))%q;
	p=(p+(L)l*r%q*k)%q;
}
int main()
{
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	int i,j,k;
	for(i=1;i<=6;i++)
	  scanf("%d",&x[i]);
	for(i=1;i<=6;i++)
	  scanf("%d",&y[i]);
	a[0]=1;
	for(i=1;i<=2e6;i++)
	  a[i]=(L)a[i-1]*i%q;
	b[0]=b[1]=1;
	for(i=2;i<=2e6;i++)
	  b[i]=q-(L)q/i*b[q%i]%q;
	for(i=1;i<=2e6;i++)
	  b[i]=(L)b[i-1]*b[i]%q;
	for(i=y[3];i<=y[4];i++)
	  {
	   calc(x[3]-1,i,x[3],i,-x[3]-i);
	   calc(x[4],i,x[4]+1,i,x[4]+i+1);
	  }
	for(i=x[3];i<=x[4];i++)
	  {
	   calc(i,y[3]-1,i,y[3],-y[3]-i);
	   calc(i,y[4],i,y[4]+1,y[4]+i+1);
	  }
	p=(p+q)%q;
	printf("%d\n",p);
	return 0;
}
