#!/bin/bash
MOD=1000000007
ans=1
read N
N=$(echo $N | sed 's/\n//g')
flag=$(tr ' ' '\n' | awk -v N=$N '{a[$1]++;flag=1} END{for(i=0;i<N/2;i++)if(a[N-2*i-1]!=(2-!(N-2*i-1)))flag=0;print flag}')
if [ $flag -eq 0 ]; then
  echo 0
else
  for i in $(seq 1 $((N/2))); do
    ans=$((ans<<1))
    ans=$((ans%MOD))
  done
  echo $ans
fi
