#include<bits/stdc++.h>
using namespace std;
const int N=2e6+50,mod=1e9+7;
int x[10],y[10],J[N],I[N],ans;
int C(int n,int m){return 1ll*J[n]*I[m]%mod*I[n-m]%mod;}
int ptp(int x,int y){return C(x+y,x);}
int pts(int x1,int y1,int x2,int y2){return (0ll+ptp(x2+1,y2+1)-ptp(x1,y2+1)-ptp(x2+1,y1)+ptp(x1,y1))%mod;}
int PTS(int x,int y,int x1,int y1,int x2,int y2){
    if(x>=x2&&y>=y2)return pts(x-x2,y-y2,x-x1,y-y1);
    return pts(x1-x,y1-y,x2-x,y2-y);
}
int main(){
    J[0]=I[0]=I[1]=1;
    for(int i=2;i<N;i++)I[i]=mod-1ll*mod/i*I[mod%i]%mod;
    for(int i=1;i<N;i++)J[i]=1ll*J[i-1]*i%mod,I[i]=1ll*I[i-1]*I[i]%mod;
    for(int i=1;i<=6;i++)scanf("%d",&x[i]);
    for(int i=1;i<=6;i++)scanf("%d",&y[i]);
    for(int i=x[3];i<=x[4];i++)
        ans=(ans-1ll*PTS(i,y[3]-1,x[1],y[1],x[2],y[2])*PTS(i,y[3],x[5],y[5],x[6],y[6])%mod*(i+y[3]))%mod;
    for(int i=y[3];i<=y[4];i++)
        ans=(ans-1ll*PTS(x[3]-1,i,x[1],y[1],x[2],y[2])*PTS(x[3],i,x[5],y[5],x[6],y[6])%mod*(x[3]+i))%mod;
    for(int i=x[3];i<=x[4];i++)
        ans=(ans+1ll*PTS(i,y[4],x[1],y[1],x[2],y[2])*PTS(i,y[4]+1,x[5],y[5],x[6],y[6])%mod*(i+y[4]+1))%mod;
    for(int i=y[3];i<=y[4];i++)
        ans=(ans+1ll*PTS(x[4],i,x[1],y[1],x[2],y[2])*PTS(x[4]+1,i,x[5],y[5],x[6],y[6])%mod*(x[4]+i+1))%mod;
    cout<<(ans+mod)%mod;
    return 0;
}