function C167(_input) {
    var lines = _input.split("\n");
    var first = lines.shift().split(' ').map(v => v*1);
    var sankonum = first[0];
    var sum = 0;
    var c = 0;
    var power = []; // p00 = Aの合計、p01 = Bの合計
    for (var i = 0; i < sankonum; i++) {
        var item = lines.shift().split(' ').map(v => v*1);
        power[i] = item;
    }
	for (var k = 0; k < sankonum - 1; k++) {
        for (var j = 1; j < sankonum; j++) {
				if(k === j){
				continue;
				}
				sum = power[k][0]*power[j][0]+power[k][1]*power[j][1];
				 	console.log(sum);
				if(sum !==0){
					c++;
				}
				console.log(c);
	        	}
       }
	c+= power.length;
    console.log(c%1000000007);
}
C167(require("fs").readFileSync("/dev/stdin", "utf8"));
