#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int MaxN = 2e6,MOD = 1e9+7;
#define x1 x1926
#define y1 y0817
int x1,x2,x3,x4,x5,x6,y1,y2,y3,y4,y5,y6;
int fac[MaxN+1],ifac[MaxN+1];

inline LL fastpow(LL a,LL p) {
    LL ret=1;
    while (p) {
        if (p&1) ret=ret*a%MOD;
        p>>=1;a=a*a%MOD;
    }
    return ret;
}
inline LL inv(const LL& x) {return fastpow(x,MOD-2);}
//inline LL C(const int& n,const int& m) {return (LL)fac[n]*ifac[m]%MOD*ifac[n-m]%MOD;}
inline LL paths(const int& x,const int& y) {return (LL)fac[x+y+2]*ifac[x+1]%MOD*ifac[y+1]%MOD;}
LL solve(int x3,int y3,int x4,int y4) {
	return (paths(x3-x1,y3-y1)-paths(x3-x1,y3-y2)-paths(x3-x2,y3-y1)+paths(x3-x2,y3-y2))*(paths(x6-x4,y6-y4)-paths(x5-x4,y6-y4)-paths(x6-x4,y5-y4)+paths(x5-x4,y5-y4))%MOD;
}
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);
    fac[1]=ifac[1]=1;
    for (int i=2;i<=MaxN;++i) fac[i]=(LL)fac[i-1]*i%MOD;
    ifac[MaxN]=inv(fac[MaxN]);
    for (int i=MaxN-1;i>=1;--i) ifac[i]=(LL)ifac[i+1]*(i+1)%MOD;
    x2++,y2++,x5--,y5--;
    LL ans=0;
    for (int i=x3;i<=x4;i++) ans+=solve(i,y4,i,y4+1)*(y4+i+1)%MOD-solve(i,y3-1,i,y3)*(y3+i)%MOD;
	for (int i=y3;i<=y4;i++) ans+=solve(x4,i,x4+1,i)*(x4+i+1)%MOD-solve(x3-1,i,x3,i)*(x3+i)%MOD;
    ans=ans%MOD+MOD;
    ans%=MOD;
    printf("%lld\n",ans);
    return 0;
}