#include <bits/stdc++.h>
using namespace std;

#define LL long long
#define LD double
#define SC(t,x) static_cast<t>(x)
#define AR(t) vector < t >
#define PII pair < int, int >
#define PLL pair < LL, LL >
#define PIL pair < int, LL >
#define PLI pair < LL, int >
#define MP make_pair
#define PB push_back
#define PF push_front
#define POB pop_back
#define POF pop_front
#define PRF first
#define PRS second
#define INIT(ar,val) memset ( ar, val, sizeof ( ar ) )
#define lp(loop,start,end) for ( int loop = start; loop < end; ++loop )
#define lpd(loop,start,end) for ( int loop = start; loop > end; --loop )
#define lpi(loop,start,end) for ( int loop = start; loop <= end; ++loop )
#define lpdi(loop,start,end) for ( int loop = start; loop >= end; --loop )
#define qmax(a,b) (((a)>(b))?(a):(b))
#define qmin(a,b) (((a)<(b))?(a):(b))
#define qabs(a) (((a)>=0)?(a):(-(a)))

const int INF = 0x3fffffff;
const int SINF = 0x7fffffff;
const long long LINF = 0x3fffffffffffffff;
const long long SLINF = 0x7fffffffffffffff;
const int MAXN = 1000007;
const int MAXN2 = 2000007;
const int MAXS = 2630007;
const int MOD = 1e9 + 7;
const int DIVI = 31622;
const int DIVI2 = 999950884;
const LD PI = acos ( -1.0 );

class CX
{
public:
	CX () : a ( 0 ), b ( 0 ) {}
	CX ( LD _a, LD _b ) : a ( _a ), b ( _b ) {}
	
	CX operator + ( const CX &x ) const
	{
		return CX ( a + x.a, b + x.b );
	}
	
	void operator += ( const CX &x )
	{
		a += x.a, b += x.b;
	}
	
	CX operator - ( const CX &x ) const
	{
		return CX ( a - x.a, b - x.b );
	}
	
	void operator -= ( const CX &x )
	{
		a -= x.a, b -= x.b;
	}
	
	CX operator * ( const CX &x ) const
	{
		return CX ( a * x.a - b * x.b, a * x.b + b * x.a );
	}
	
	void operator *= ( const CX &x )
	{
		( *this ) = ( *this ) * x;
	}
	
	CX operator = ( LD x )
	{
		a = x, b = 0;
		return ( *this );
	}
	
	LD real ()
	{
		return a;
	}
	
	friend CX conj ( const CX x )
	{
		return CX ( x.a, -x.b );
	}
	
private:
	LD a, b;
};

int a1, a2, a3, a4, a5, a6;
int b1, b2, b3, b4, b5, b6;
int vl[MAXN], vr[MAXN], vu[MAXN], vd[MAXN], mr[MAXN2];
CX ca0[MAXS], ca1[MAXS], cb0[MAXS], cb1[MAXS], *cans0 = ca0, *cans1 = ca1, *cans2 = cb0, omega[MAXS];
int frac[MAXN2], rf[MAXN2];

void init ();
void input ();
void work ();



int add ( int x, int y )
{
	x += y;
	if ( x >= MOD ) x -= MOD;
	return x;
}

void addv ( int &x, int y )
{
	x += y;
	if ( x >= MOD ) x -= MOD;
}

int dec ( int x, int y )
{
	x -= y;
	if ( x < 0 ) x += MOD;
	return x;
}

void decv ( int &x, int y )
{
	x -= y;
	if ( x < 0 ) x += MOD;
}

int qpow ( int a, int b )
{
	LL base = a, ans = 1;
	while ( b ){
		if ( b & 1 ) ( ans *= base ) %= MOD;
		( base *= base ) %= MOD;
		b >>= 1;
	}
	return SC ( int, ans );
}



void fft ( CX ar[], int tn );
void mul ( int a[], int n, int b[], int m, int ans[] );



int C ( int n, int m )
{
//	cerr << n << " " << m << " : " << frac[n] << " " << rf[m] << " " << rf[n-m] << endl;
	return SC ( int, SC ( LL, frac[n] ) * rf[m] % MOD * rf[n-m] % MOD );
}

int getmd ( int n, int m, int a, int b )
{
	return add ( dec ( dec ( C ( a+n+b+m, a+n ), C ( a+b+m, a ) ), C ( a+n+b, b ) ), C ( a+b, a ) );
}



int main ()
{
	init ();
	input ();
	work ();
}



void init ()
{
	// Init Everything Here

	ios::sync_with_stdio ( false );
	
	frac[0] = 1;
	lp ( i, 1, MAXN2 ) frac[i] = SC ( LL, frac[i-1] ) * i % MOD;
	rf[MAXN2-1] = qpow ( frac[MAXN2-1], MOD-2 );
	lpdi ( i, MAXN2-2, 0 ) rf[i] = SC ( LL, rf[i+1] ) * ( i + 1 ) % MOD;
}

void input ()
{
	// input method
	
	cin >> a1 >> a2 >> a3 >> a4 >> a5 >> a6;
	cin >> b1 >> b2 >> b3 >> b4 >> b5 >> b6;
}

void work ()
{
	// main work
	
	int ans = 0;
	
	int n = a4 - a3 + 1, m = b4 - b3 + 1;
	int dx1 = a2 - a1 + 1, dx2 = a6 - a5 + 1, dy1 = b2 - b1 + 1, dy2 = b6 - b5 + 1;
	lp ( i, 0, n ){
		vd[i] = getmd ( dx1, dy1, ( i + a3 ) - a2, b3 - 1 - b2 );
		vu[i] = getmd ( dx2, dy2, a5 - ( i + a3 ), b5 - ( b4 + 1 ) );
	}
	lp ( i, 0, m ){
		vl[i] = getmd ( dx1, dy1, a3 - 1 - a2, ( i + b3 ) - b2 );
		vr[i] = getmd ( dx2, dy2, a5 - ( a4 + 1 ), b5 - ( i + b3 ) );
	}
	
	reverse ( vu, vu+n );
	reverse ( vr, vr+m );
	
//	cerr << "END PREPROCESS" << endl;
	
	mul ( vd, n - 1, vu, n - 1, mr );
	lp ( i, 0, n ) addv ( ans, SC ( LL, mr[i] ) * C ( m+n-i-2, m-1 ) % MOD * ( m + n - i - 1 ) % MOD );
	mul ( vl, m - 1, vr, m - 1, mr );
	lp ( i, 0, m ) addv ( ans, SC ( LL, mr[i] ) * C ( n+m-i-2, n-1 ) % MOD * ( n + m - i - 1 ) % MOD );
	
	reverse ( vu, vu+n );
	reverse ( vr, vr+m );
	reverse ( vd, vd+n ); 
	reverse ( vl, vl+m );
	
	lp ( i, 0, n ) vd[i] = SC ( int, SC ( LL, vd[i] ) * rf[i] % MOD ), vu[i] = SC ( int, SC ( LL, vu[i] ) * rf[i] % MOD );
	lp ( i, 0, m ) vl[i] = SC ( int, SC ( LL, vl[i] ) * rf[i] % MOD ), vr[i] = SC ( int, SC ( LL, vr[i] ) * rf[i] % MOD );
	
	mul ( vd, n - 1, vr, m - 1, mr );
	lp ( i, 0, n+m-1 ) addv ( ans, SC ( LL, mr[i] ) * ( i + 1 ) % MOD * frac[i] % MOD );
	mul ( vu, n - 1, vl, m - 1, mr );
	lp ( i, 0, n+m-1 ) addv ( ans, SC ( LL, mr[i] ) * ( i + 1 ) % MOD * frac[i] % MOD );
	
	cout << ans << endl;
}



void fft ( CX ar[], int tn )
{
	for ( int i = 0, j = 0; i < tn; ++i ){
		if ( i > j ) swap ( ar[i], ar[j] );
		for ( int b = tn >> 1; b && ( ! ( ( j ^= b ) & b ) ); b >>= 1 );
	}
	
	int m;
	CX x, y;
	for ( int i = 2; i <= tn; i <<= 1 ){
		m = i >> 1;
		for ( int j = 0; j < tn; j += i ){
			lp ( k, 0, m ){
				x = ar[j+k], y = ar[j+k+m] * omega[tn/i*k];
				ar[j+k] = x + y;
				ar[j+k+m] = x - y;
			}
		}
	}
}

void mul ( int a[], int n, int b[], int m, int ans[] )
{
	int nm = n + m;
	int tn = 1;
	while ( tn <= nm ) tn <<= 1;
	lpi ( i, 0, n ) ca0[i] = a[i] % DIVI, ca1[i] = a[i] / DIVI;
	lp ( i, n+1, tn ) ca0[i] = ca1[i] = 0;
	lpi ( i, 0, m ) cb0[i] = b[i] % DIVI, cb1[i] = b[i] / DIVI;
	lp ( i, m+1, tn ) cb0[i] = cb1[i] = 0;
	lp ( i, 0, tn ) omega[i] = CX ( cos ( 2 * PI * i / tn ), sin ( 2 * PI * i / tn ) );
	fft ( ca0, tn );
	fft ( ca1, tn );
	fft ( cb0, tn );
	fft ( cb1, tn );
	CX t0, t1, t2;
	lp ( i, 0, tn ){
		t0 = ca0[i] * cb0[i];
		t1 = ca0[i] * cb1[i] + ca1[i] * cb0[i];
		t2 = ca1[i] * cb1[i];
		cans0[i] = t0, cans1[i] = t1, cans2[i] = t2;
		omega[i] = conj ( omega[i] );
	}
	fft ( cans0, tn );
	fft ( cans1, tn );
	fft ( cans2, tn );
	lpi ( i, 0, nm ) ans[i] = SC ( int, ( ( SC ( LL, floor ( cans2[i].real () / tn + 0.5 ) ) % MOD * DIVI2 ) + ( SC ( LL, floor ( cans1[i].real () / tn + 0.5 ) ) % MOD * DIVI ) + SC ( LL, floor ( cans0[i].real () / tn + 0.5 ) ) ) % MOD );
}

Measured memory_bytes: 244736