'use strict';

Array.prototype._sort = Array.prototype.sort;
Array.prototype.sort = function (fn) {
	if (fn) {
		return this._sort(fn);
		
	} else if (typeof this[0] === 'number') {
		return this._sort((a, b) => a - b);
	
	} else {
		return this._sort();
	}
};

let memoFact = new Map();
function fact(n) {
	if (memoFact.has(n)) return memoFact.get(n);
	if (n <= 1) return 1;

	let res = n * fact(n - 1);
	memoFact.set(n, res);
	
	return res;
}

function gcd(a, b) {
	while (true) {
		if (a > b) {
			a = a % b;
			if (a === 0) return b;
		} else {
			b = b % a;
			if (b === 0) return a;
		}
	}
}

class Graph {
	constructor() {
		this.nodes = new Map();
		this.edges = [];
	}
	
	static fromNodePair(pairs) {
		let graph = new Graph(),
			nodes = graph.nodes,
			edges = graph.edges;
		
		for (let ab of pairs) {
			let a = ab[0], b = ab[1];
			
			if (!nodes.has(a)) nodes.set(a, []);
			if (!nodes.has(b)) nodes.set(b, []);
			
			let nodeA = nodes.get(a),
				nodeB = nodes.get(b);
			
			nodeA[nodeA.length] = b;
			nodeB[nodeB.length] = a;
			edges[edges.length] = [a, b];
		}
		
		return graph;
	}
}

const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\n');

const N = Number(lines[0])
const AB = lines.slice(1).map(ab => ab.split(' ').map(Number));

let X = 0;
for (let i = 0; i < N; i++) {
	for (let j = i+1; j < N; j++) {
		let ai = AB[i][0],
			bi = AB[i][1],
			aj = AB[j][0],
			bj = AB[j][1];

		X += fact(ai+aj+bi+bj)/fact(ai+aj)/fact(bi+bj);
	}
}

console.log(X % (1e9+7));