#include<cstdio>
#include<cstdlib>
#define maxn 2000005
#define mod 1000000007
using namespace std;
int add(int x,int y){x+=y; return x>=mod?x-mod:x;}
int sub(int x,int y){x-=y; return x<0?x+mod:x;}
int mul(int x,int y){return 1ll*x*y%mod;}
int ksm(int a,int b)
{
    int s=1;
    for(;b;a=mul(a,a),b>>=1)
        if(b&1) s=mul(s,a);
    return s;
}
int inv[maxn],fac[maxn],ans;
int x1,x2,x3,x4,x5,x6;
int y1,y2,y3,y4,y5,y6;
int C(int n,int m){return mul(fac[n],mul(inv[m],inv[n-m]));}
int ld(int x,int y)
{
    int tmp=C(x-x2-1+y-y2-1,x-x2-1);
    tmp=sub(tmp,add(C(x-x2-1+y-y1,x-x2-1),C(x-x1+y-y2-1,x-x1)));
    tmp=add(tmp,C(x-x1+y-y1,x-x1));
    return tmp;
}
int rd(int x,int y)
{
    int tmp=C(x5-x-1+y5-y-1,x5-x-1);
    tmp=sub(tmp,add(C(x6-x+y5-y-1,x6-x),C(x5-x-1+y6-y,x5-x-1)));
    tmp=add(tmp,C(x6-x+y6-y,x6-x));
    return tmp;
}
int main()
{
    scanf("%d%d%d%d%d%d",&x1,&x2,&x3,&x4,&x5,&x6);
    scanf("%d%d%d%d%d%d",&y1,&y2,&y3,&y4,&y5,&y6);
    x1--,y1--,x2--,y2--;
    x5++,y5++,x6++,y6++;
    inv[0]=fac[0]=1;
    for(int i=1;i<maxn;i++)
        inv[i]=mul(inv[i-1],ksm(i,mod-2)),fac[i]=mul(fac[i-1],i);
    for(int i=y3;i<=y4;i++)
    {
        ans=add(ans,mul(mod-x3-i+1,mul(ld(x3-1,i),rd(x3,i))));
        ans=add(ans,mul(x4+i,mul(ld(x4,i),rd(x4+1,i))));
    }
    for(int i=x3;i<=x4;i++)
    {
        ans=add(ans,mul(mod-y3-i+1,mul(ld(i,y3-1),rd(i,y3))));
        ans=add(ans,mul(y4+i,mul(ld(i,y4),rd(i,y4+1))));
    }
    printf("%d\n",ans);
}