# BZOJ 4767: 两双手 [DP 组合数]

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long ll;
const int N=505,M=1e6,P=1e9+7;
char c=getchar();int x=0,f=1;
while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
return x*f;
}
int x,y,n,x1,y1,x2,y2;
struct Point{
int x,y;
bool operator <(const Point &r)const{return x<r.x || (x==r.x && y<r.y);}
}a[N];
int m;
bool solEqu(int x,int y,Point &p){//printf("solEqu %d %d\n",x,y);
int a=x*y1-y*x1,b=x2*y1-y2*x1;//printf("a b %d %d\n",a,b);
if(a%b) return 0;else p.x=a/b;
a=x*y2-y*x2,b=x1*y2-y1*x2;//printf("a b %d %d\n",a,b);
if(a%b) return 0;else p.y=a/b;//printf("Point %d %d\n",p.x,p.y);
return 1;
}
ll inv[M],fac[M],facInv[M];
void ini(int n){
inv[1]=1;fac[0]=facInv[0]=1;
for(int i=1;i<=n;i++){
if(i!=1) inv[i]=(P-P/i)*inv[P%i]%P;
fac[i]=fac[i-1]*i%P;
facInv[i]=facInv[i-1]*inv[i]%P;
}
}
inline ll C(int n,int m){return fac[n]*facInv[m]%P*facInv[n-m]%P;}
ll f[N];
inline void modify(ll &x){if(x<0) x+=P;}
void dp(){
for(int i=1;i<=m;i++){
f[i]=C(a[i].x+a[i].y,a[i].x);
for(int j=1;j<i;j++) if(a[j].x<=a[i].x && a[j].y<=a[i].y)
modify(f[i]-=C(a[i].x-a[j].x+a[i].y-a[j].y , a[i].x-a[j].x) * f[j] %P);
}
}
int main(){
freopen("in","r",stdin);
ini(500000);
if(!solEqu(x,y,a[++m])) {puts("0");return 0;}
for(int i=1;i<=n;i++){
}