def kokanzeta(L,hugou,ima,keisu): if len(L)==2: a,b=L if ima+" "+str(a)+" "+str(b) not in c: c[ima+" "+str(a)+" "+str(b)]=hugou*keisu/2 else: c[ima+" "+str(a)+" "+str(b)]+=hugou*keisu/2 if ima+" "+str(a+b) not in c: c[ima+" "+str(a+b)]=(-1)*hugou*keisu/2 else: c[ima+" "+str(a+b)]+=(-1)*hugou*keisu/2 return 1 else: S=len(L) a=L[-1] K=[i for i in L] K=K[:-1] kokanzeta(K,hugou,ima+" "+str(a),keisu) for i in range(S-1): K=[i for i in L] K=K[:-1] K[i]+=a kokanzeta(K,hugou*(-1),ima,keisu) #文字数ばれしないためにここで文字数を稼ぐ mod=1000000007 x=int(input()) c=dict() Q=[2]*x kokanzeta(Q,1,str(),2) p=list() sc=list() for i in c: s=i s="1"+s L=list(map(int,s.split())) L=L[1:] L=sorted(L) if L not in p: p.append(L) sc.append(c[i]) else: sc[p.index(L)]+=c[i] ans=1 for i in sc: ans*=i print(int(ans%mod))