#include<bits/stdc++.h>
#define LL long long
using namespace std;
inline LL read(){
	LL res=0,fl=1;
	char ch=getchar();
	while(!(ch>='0' && ch<='9')){
		if(ch=='-')fl=-1;
		ch=getchar();
	}
	while(ch>='0' && ch<='9')res=res*10+ch-'0',ch=getchar();
	return res*fl;
}
const LL N=1e5+5,mod=1e9+7;
LL inv[3];
int main(){
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	inv[0]=inv[1]=1;
	inv[2]=(mod-mod/2)*inv[mod%2]%mod;
	cout<<inv[2];
	return 0;
}
