#include <cstdio>
#define MOD 1000000007
typedef long long ll;
inline ll quick_pow(ll a, int n)
{
	ll res = 1;
	while (n)
	{
		if (n & 1)
			res = res * a % MOD;
		a = a * a % MOD;
		n >>= 1;
	}
	return res;
}
ll fact[2000005], inv[2000005];
inline ll calc(int n, int m)
{
	return fact[n + m] * inv[n] % MOD * inv[m] % MOD;
}
inline ll calc(int x1, int x2, int y1, int y2)
{
	return calc(x2 + 1, y2 + 1) - calc(x1, y2 + 1) - calc(x2 + 1, y1) + calc(x1, y1);
}
inline void init()
{
	const int mx = 2e6;
	fact[0] = 1;
	for (int i = 1; i <= mx; i++)
		fact[i] = fact[i - 1] * i % MOD;
	inv[mx] = quick_pow(fact[mx], MOD - 2);
	for (int i = mx; i; i--)
		inv[i - 1] = inv[i] * i % MOD;
}
int main()
{
	// freopen("AGC018-E.in", "r", stdin);
	init();
	int x1, x2, x3, x4, x5, x6, y1, y2, y3, y4, y5, y6;
	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);
	ll ans = 0;
	for (int i = x3; i <= x4; i++)
	{
		(ans -= (i + y3) * calc(i - x2, i - x1, y3 - y2 - 1, y3 - y1 - 1) % MOD * calc(x5 - i, x6 - i, y5 - y3, y6 - y3)) %= MOD;
		(ans += (i + y4 + 1) * calc(i - x2, i - x1, y4 - y2, y4 - y1) % MOD * calc(x5 - i, x6 - i, y5 - y4 - 1, y6 - y4 - 1)) %= MOD;
	}
	for (int i = y3; i <= y4; i++)
	{
		(ans -= (i + x3) * calc(x3 - x2 - 1, x3 - x1 - 1, i - y2, i - y1) % MOD * calc(x5 - x3, x6 - x3, y5 - i, y6 - i)) %= MOD;
		(ans += (i + x4 + 1) * calc(x4 - x2, x4 - x1, i - y2, i - y1) % MOD * calc(x5 - x4 - 1, x6 - x4 - 1, y5 - i, y6 - i)) %= MOD;
	}
	printf("%lld\n", (ans + MOD) % MOD);
	return 0;
}
