#pragma GCC optimize("2,Ofast,inline")
#include<cstdio>
#include<iostream>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define LL long long
#define pii pair<int, int>
using namespace std;
const int N = 1e6 + 10;
const int mod = 1e9 + 7;
 
template <typename T> T read(T &x) {
	int f = 0;
	register char c = getchar();
	while (c > '9' || c < '0') f |= (c == '-'), c = getchar();
	for (x = 0; c >= '0' && c <= '9'; c = getchar())
		x = (x << 3) + (x << 1) + (c ^ 48);
	if (f) x = -x;
	return x;
}

namespace Comb {
	const int Maxn = 2e6 + 10;
	
	int fac[Maxn], fav[Maxn], inv[Maxn];
	
	void comb_init() {
		fac[0] = fav[0] = 1;
		inv[1] = fac[1] = fav[1] = 1;
		for (int i = 2; i < Maxn; ++i) {
			fac[i] = 1LL * fac[i - 1] * i % mod;
			inv[i] = 1LL * -mod / i * inv[mod % i] % mod + mod;
			fav[i] = 1LL * fav[i - 1] * inv[i] % mod;
		}
	}
 
	inline int C(int x, int y) {
		if (x < y || y < 0) return 0;
		return 1LL * fac[x] * fav[y] % mod * fav[x - y] % mod;
	}

	inline int Qpow(int x, int p) {
		int ans = 1;
		for (; p; p >>= 1) {
			if (p & 1) ans = 1LL * ans * x % mod;
			x = 1LL * x * x % mod;
		}
		return ans;
	}

	inline int Inv(int x) {
		return Qpow(x, mod - 2);
	}
 
	inline void upd(int &x, int y) {
		(x += y) >= mod ? x -= mod : 0;
	}

	inline int add(int x, int y) {
		return (x += y) >= mod ? x - mod : x;
	}

	inline int dec(int x, int y) {
		return (x -= y) < 0 ? x + mod : x;
	}

}
using namespace Comb;

int x1, x2, x3, x4, x5, x6;
int y1, y2, y3, y4, y5, y6;

int f(int x, int y) {
	return dec(C(x + y + 2, x + 1), 1);
}

int calc(int x1, int x2, int y1, int y2) {
	int ans = 0;
	ans = add(ans, f(x2, y2));
	ans = add(ans, f(x1 - 1, y1 - 1));
	ans = dec(ans, f(x2, y1 - 1));
	ans = dec(ans, f(x1 - 1, y2));
	return ans;
}

int main() {
	comb_init();
	read(x1); read(x2); read(x3); read(x4); read(x5); read(x6);
	read(y1); read(y2); read(y3); read(y4); read(y5); read(y6);
	int ans = 0;
	// for (int i = x1; i <= x2; ++i) {
	// 	int s1 = calc(x5 - i, x6 - i, y5 - y2, y6 - y2);
	// 	int s2 = add(1, i == x2 ? 0 : calc(0, i - x1, 0, y2 - y1));
	// 	upd(ans, 1LL * s1 * s2 % mod);
	// }
	// for (int i = y1; i < y2; ++i) {
	// 	int s1 = calc(x5 - x2, x6 - x2, y5 - i, y6 - i);
	// 	int s2 = add(1, calc(0, x2 - x1, 0, i - y1));
	// 	upd(ans, 1LL * s1 * s2 % mod);
	// }
	for (int i = x3; i <= x4; ++i) {
		int s1 = calc(i - x2, i - x1, y3 - y2 - 1, y3 - y1 - 1);
		int s2 = calc(x5 - i, x6 - i, y5 - y3, y6 - y3);
		ans = dec(ans, 1LL * s1 * s2 % mod * (i + y3) % mod);
	}
	for (int i = y3; i <= y4; ++i) {
		int s1 = calc(x3 - x2 - 1, x3 - x1 - 1, i - y2, i - y1);
		int s2 = calc(x5 - x3, x6 - x3, y5 - i, y6 - i);
		ans = dec(ans, 1LL * s1 * s2 % mod * (i + x3) % mod);
	}
	for (int i = x3; i <= x4; ++i) {
		int s1 = calc(i - x2, i - x1, y4 - y2, y4 - y1);
		int s2 = calc(x5 - i, x6 - i, y5 - y4 - 1, y6 - y4 - 1);
		ans = add(ans, 1LL * s1 * s2 % mod * (i + y4 + 1) % mod);
	}
	for (int i = y3; i <= y4; ++i) {
		int s1 = calc(x4 - x2, x4 - x1, i - y2, i - y1);
		int s2 = calc(x5 - x4 - 1, x6 - x4 - 1, y5 - i, y6 - i);
		ans = add(ans, 1LL * s1 * s2 % mod * (i + x4 + 1) % mod);
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 23680