qyliang/CodeNanoFix huggingface dataset:
# Buggy code:
n=int(input())
*A=sorted(map(int,input().split()))

a=True
if n%2==0:
  for i in range(1,n,2):
    if A[i-1]!=i or A[i]!=i:
      a=False
      break
else:
  if A[0]!=0:a=False
  else:
    for i in range(2,n,2):
      if A[i-1]!=i or A[i]!=i:
        a=False
        break
print(2**(n//2)%(10**9+7) if a else 0)


# Fixed code:
N=int(input())
*A,=sorted(map(int,input().split()))

a=True
if N%2==0:
 for i in range(1,N,2):
  if A[i-1]!=i or A[i]!=i:
    a=False
    break
else:
 if A[0]!=0:a=False
 else:
    for i in range(2,N,2):
     if A[i-1]!=i or A[i]!=i:
        a=False
        break
print(2**(N//2)%(10**9+7) if a else 0)
# Buggy code:
N=int(input())
S=list(map(int,input().split()))
lenS=len(S)
T=[]
for i in range(1,N+1):
    T.append(abs(i-(N+1-i)))

T.sort()
S.sort()


'''
for i in range(N):
    if T!=S:
        print(0)
        exit()


ans=1
nagasa=lenS//2
for i in range(nagasa):
    
    ans=(ans*2)%(10**9+7)

print(ans)


'''

# Fixed code:
N=int(input())
S=list(map(int,input().split()))
lenS=len(S)
T=[]
for i in range(1,N+1):
    T.append(abs(i-(N+1-i)))

T.sort()
S.sort()



for i in range(N):
    if T[i]!=S[i]:
        print(0)
        exit()


ans=1
nagasa=lenS//2
for i in range(nagasa):
    
    ans=(ans*2)%(10**9+7)

print(ans)
# Buggy code:
from collections import Counter

N= int(input())
Alist = list(map(int, input().split())) 


count = Counter(Alist)
res = 1
if N % 2 ==0:
    for i in range(1,N,2):
        if count[i] != 2:
            print(0)
            exit()
else:
    if count[0] != 1:
        print(0)
        exit()
    else:
        for i in range(2,N,2):
            count[i] != 2
            print(0)
            exit()
print(2**(N//2) % (10**9+7))

# Fixed code:
from collections import Counter

N= int(input())
Alist = list(map(int, input().split())) 

count = Counter(Alist)
res = 1
if N % 2 ==0:
    for i in range(1,N,2):
        if count[i] != 2:
            print(0)
            exit()
else:
    if count[0] != 1:
        print(0)
        exit()
    else:
        for i in range(2,N,2):
            if count[i] != 2:
                print(0)
                exit()
print(2**(N//2) % (10**9+7))
# Buggy code:
n = int(input())
l = sorted(list(map(int, input().split())))
print(n,l)

if n == 1 and l ==[0, 0]:
    print(1)
else:
    a = []
    for i in range(1, n):
        if n % 2 == 1: # odd
            if i < n and i % 2 == 0:
                a += [i] * 2
        else:
            if i < n and i % 2 == 1:
                a += [i] * 2
    else:
        if n % 2 == 1:
            a.insert(0, 0)
    
if l != a:
    print(0)
else:
    print(2 ** (n // 2))

# Fixed code:
n = int(input())
l = sorted(list(map(int, input().split())))

if n == 1 and l ==[0, 0]:
    print(1)
    exit()
else:
    a = []
    for i in range(1, n):
        if n % 2 == 1: # odd
            if i < n and i % 2 == 0:
                a += [i] * 2
        else:
            if i < n and i % 2 == 1:
                a += [i] * 2
    else:
        if n % 2 == 1:
            a.insert(0, 0)
    
if l != a:
    print(0)
else:
    print((2 ** (n // 2)) % (10**9 + 7))
# Buggy code:
n=int(input())
a=list(map(int,input().split()))
if n%2==1:
    x=[i for i in range(n)]
    for i in range(n):
        if i%2==1:
            x[i]+=1
else:
    x=[i for i in range(n)]
    for i in range(n):
        if i%2==0:
            x[i]+=1
a.sort()
if x==a:
    print(pow(2,((n+1)//2-1),10**9+7))
else:
    print(0)

# Fixed code:
n=int(input())
a=list(map(int,input().split()))
if n%2==1:
    x=[i for i in range(n)]
    for i in range(n):
        if i%2==1:
            x[i]+=1
else:
    x=[i for i in range(n)]
    for i in range(n):
        if i%2==0:
            x[i]+=1
a.sort()
if x==a:
    print(pow(2,(n//2),10**9+7))
else:
    print(0)
# Buggy code:
n=int(input())
l=list(map(int,input().split()))
mod=10**9+7
if n%2==0:
    d={i:2 for i in range(1,n,2)}
else:
    d={i:2 for i in range(0,n,2)}
    d[0]=1
print('def:',d)
for a in l:
    if a in d:
        d[a]-=1
    else:
        print(0)
        exit()
    print(a,d)
for i in d.values():
    if i!=0:
        print(0)
        exit()
print(2**(n//2)%mod)


# Fixed code:
n=int(input())
l=list(map(int,input().split()))
mod=10**9+7
if n%2==0:
    d={i:2 for i in range(1,n,2)}
else:
    d={i:2 for i in range(0,n,2)}
    d[0]=1
for a in l:
    if a in d:
        d[a]-=1
    else:
        print(0)
        exit()
for i in d.values():
    if i!=0:
        print(0)
        exit()
print((2**(n//2))%mod)
# Buggy code:

N = int(input())
A = list(map(int, input().split()))

A_ = sorted(A)

if len(A_) == 1:
    if A_[0] == 0:
        print(1)
    else:
        print(0)

elif A_[0] == A_[1] == 0:
    print(0)

else:
    ans_ = 2 ** (N // 2)

    for i in range(len(A_) // 2):
        if A_[2*i] != A_[2*i+1]:
            print(0)
            exit()


    ans = ans_ % (10**9 + 7)
    print(ans)


# Fixed code:

N = int(input())
A = list(map(int, input().split()))

A_ = sorted(A)

if len(A_) == 1:
    if A_[0] == 0:
        print(1)
    else:
        print(0)

elif A_[0] == A_[1] == 0:
    print(0)

else:
    ans_ = 2 ** (N // 2)
    ans = ans_ % (10**9 + 7)


    if len(A_) % 2 == 0:
        for i in range(len(A_) // 2):
            if A_[2*i] != A_[2*i+1]:
                print(0)
                exit()

    else:
        if A_[0] != 0:
            print(0)
            exit()

        for i in range(len(A_) // 2):
            if A_[2*i+1] != A_[2*i+2]:
                print(0)
                exit()


    print(ans)
# Buggy code:
import math
import sys
import collections

n = int(input())
a = list(map(int, input().split()))
ans = 0
counts = collections.Counter(a)
mod = 10**9+7
print(counts)

if n % 2 == 1:
    # if counts[0] is None or counts[0] != 1:
    if counts[0] != 1:
        print(0)
        sys.exit()
    for i in range(2, n-1, 2):
        if counts[i] != 2:
            print(0)
            sys.exit()
else:
    for i in range(1, n-1, 2):
        if counts[i] != 2:
            print(0)
            sys.exit()

ans = 2**(n//2)

print(ans%mod)

# Fixed code:
import math
import sys
import collections

n = int(input())
a = list(map(int, input().split()))
ans = 0
counts = collections.Counter(a)
mod = 10**9+7


if n % 2 == 1:
    # if counts[0] is None or counts[0] != 1:
    if counts[0] != 1:
        print(0)
        sys.exit()
    for i in range(2, n-1, 2):
        if counts[i] != 2:
            print(0)
            sys.exit()
else:
    for i in range(1, n-1, 2):
        if counts[i] != 2:
            print(0)
            sys.exit()

ans = 2**(n//2)

print(ans%mod)
# Buggy code:
n=int(input())
a=list(map(int,input().split()))
mod=10**9+7
from collections import Counter
data=Counter(a)
if n%2==0:
    if 0 in a:
        print(0)
        exit()
    for i in data.values():
        if i!=2:
            print(0)
            exit()
    print((2**(n//2))%mod)
else:
    if a.count(0)!=1:
        print(0)
        exit()
    for i in data.values():
        if i!=2:
            print(0)
            exit()
    print((2**(n//2))%mod)


# Fixed code:
n=int(input())
a=list(map(int,input().split()))
mod=10**9+7
from collections import Counter
data=Counter(a)
if n%2==0:
    if 0  in a:
        print(0)
        exit()
    else:
        for i in data.values():
            if i!=2:
                print(0)
                exit()
    print((2**(n//2))%mod)
else:
    if a.count(0)!=1:
        print(0)
        exit()
    else:
        a.remove(0)
        data=Counter(a)
        for i in data.values():
            if i!=2:
                print(0)
                exit()
    print((2**(n//2))%mod)
# Buggy code:
N = int(input())
A = list(map(int, input().split()))
MOD = 10 ** 9 + 7
A.sort()
B = []

if len(A) % 2 == 0:
    ans = 2 ** (len(A)/2)
    for i in range(len(A)//2):
        B.append(2 * i + 1)
        B.append(2 * i + 1)

else:
    ans = 2 ** (len(A)//2)
    B.append(0)
    for i in range(len(A)//2):
        B.append(2 * i + 2)
        B.append(2 * i + 2)

if A == B:
    print(int(ans/MOD))
else:
    print(0)


# Fixed code:
N = int(input())
A = list(map(int, input().split()))
MOD = 10 ** 9 + 7
A.sort()
B = []

ans = 1

if len(A) % 2 == 0:
    for i in range(len(A)//2):
        ans *= 2
        ans %= MOD
        B.append(2 * i + 1)
        B.append(2 * i + 1)

else:
    B.append(0)
    for i in range(len(A)//2):
        ans *= 2
        ans %= MOD
        B.append(2 * i + 2)
        B.append(2 * i + 2)

if A == B:
    print(int(ans))
else:
    print(0)
# Buggy code:
import sys
from collections import Counter

MOD = 10 ** 9 + 7

n, *a = map(int, sys.stdin.read().split())

def main():
    c = Counter(a)
    if n & 1:
        if c.get(0, 0) != 1:
            return 0
    for i in range(1 + n&1, n, 2):
        if c.get(i, 0) != 2:
            return 0

    return pow(2, n // 2, MOD)
    
if __name__ == '__main__':
    ans = main()
    print(ans)

# Fixed code:
import sys
from collections import Counter

MOD = 10 ** 9 + 7

n, *a = map(int, sys.stdin.read().split())

def main():
    c = Counter(a)
    if n & 1:
        if c.get(0, 0) != 1:
            return 0
        for i in range(2, n, 2):
            if c.get(i, 0) != 2:
                return 0
    else:
        for i in range(1, n, 2):
            if c.get(i, 0) != 2:
                return 0

    return pow(2, n // 2, MOD)
    
if __name__ == '__main__':
    ans = main()
    print(ans)
# Buggy code:
import sys


def test(a):
    if len(a) % 2:
        if a[0]:
            return False

        del a[0]

    for i in range(0, len(a) - 2, 2):
        if a[i] != a[i + 1] or a[i + 2] - a[i] != 2:
            return False

    return True


input()
a = sorted(list(map(int, input().split())))
print(a)

if a[:2] == [0, 0]:
    print(0)
    sys.exit(0)

if a == [0] or a == [1, 1]:
    print(1)
    sys.exit(0)

elif a == [0, 1, 1]:
    print(2)
    sys.exit(0)

print(2 ** round(len(a)/2) if test(a) else 0)

# Fixed code:
import sys


def test(a):
    if len(a) % 2:
        if a[0]:
            return False

        del a[0]

    for i in range(0, len(a) - 2, 2):
        if a[i] != a[i + 1] or a[i + 2] - a[i] != 2:
            return False

    return True


input()
a = sorted(list(map(int, input().split())))

if a[:2] == [0, 0]:
    print(0)
    sys.exit(0)

elif a == [0]:
    print(1)
    sys.exit(0)

elif a == [0, 1, 1] or a == [1, 1]:
    print(2)
    sys.exit(0)

print((2 ** round(len(a) / 2)) % (10 ** 9 + 7) if test(a) else 0)
# Buggy code:
N = int(input())

A = sorted([int(_) for _ in input().split()])
if N % 2 == 1:
    if A[0] != 0:
        print(0)
        exit()
    A.pop(0)
    s = 2
else:
    s = 1

ans = 1
MOD = 10 ** 9 + 7
for i in range(0, N // 2):
    v = s + 2 * i
    j = 2 * i
    if A[j] != v and A[j + 1] != v:
        print(0)
        exit()
    ans *= 2
    ans %= MOD

print(ans)


# Fixed code:
N = int(input())

A = sorted([int(_) for _ in input().split()])
if N % 2 == 1:
    if A[0] != 0:
        print(0)
        exit()
    A.pop(0)
    s = 2
else:
    s = 1

ans = 1
MOD = 10 ** 9 + 7
for i in range(0, N // 2):
    v = s + 2 * i
    j = 2 * i
    # print(v, A[j],A[j+1])
    if A[j] != v or A[j + 1] != v:
        print(0)
        exit()
    ans *= 2
    ans %= MOD

print(ans)
# Buggy code:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections

n = int(input())
a = list(map(int,input().split()))

if n%2 == 0:
    c = collections.Counter(a)
    item = []
    for key,value in c.items():
        item.append([key,value])
    item.sort()
    ans = 1
    for i in range(len(item)):
        if 2*i + 1 == item[i][0]:
            if item[i][1] == 2:
                ans *= 2
                ans %=MOD
            else:
                print(0)
                sys.exit()
        else:
            print(0)
            sys.exit()
    print(ans%MOD)
else:
    c = collections.Counter(a)
    ans = 1
    item = []
    for key,value in c.items():
        item.append([key,value])
    item.sort()
    for i in range(1,len(item)):
        if 2*i == item[i][0]:
            if item[i][1] == 2:
                ans *= 2
                ans %=MOD
            else:
                print(0)
                sys.exit()
        else:
            print(0)
            sys.exit()
    if item[0][0] == 0 and item[0][1] == 1:
        print(ans%MOD)
    else:
        print(0)

# Fixed code:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
MOD = 10**9+7
n = int(input())
a = list(map(int,input().split()))

if n%2 == 0:
    c = collections.Counter(a)
    item = []
    for key,value in c.items():
        item.append([key,value])
    item.sort()
    ans = 1
    for i in range(len(item)):
        if 2*i + 1 == item[i][0]:
            if item[i][1] == 2:
                ans *= 2
                ans %=MOD
            else:
                print(0)
                sys.exit()
        else:
            print(0)
            sys.exit()
    print(ans%MOD)
else:
    c = collections.Counter(a)
    ans = 1
    item = []
    for key,value in c.items():
        item.append([key,value])
    item.sort()
    for i in range(1,len(item)):
        if 2*i == item[i][0]:
            if item[i][1] == 2:
                ans *= 2
                ans %=MOD
            else:
                print(0)
                sys.exit()
        else:
            print(0)
            sys.exit()
    if item[0][0] == 0 and item[0][1] == 1:
        print(ans%MOD)
    else:
        print(0)
# Buggy code:
import collections

N = int(input())
A = [int(i) for i in input().split()]
ans = 0
di = collections.Counter(A)
if N % 2 != 0:
    num_list = [int(i) for i in range(2, N, 2)]
    for num in num_list:
        if di[num] != 2:
            break
    else:
        if A.count(0) == 0:
            ans = (2 ** (N // 2)) % (10 ** 7 + 7)

else:
    num_list = [int(i) for i in range(1, N, 2)]
    for i in num_list:
        if di[i] != 2:
            break
    else:
        ans = (2 ** (N // 2)) % (10 ** 7 + 7)



print(ans)


# Fixed code:
import collections

N = int(input())
A = [int(i) for i in input().split()]
ans = 0
di = collections.Counter(A)
if N % 2 != 0:
    num_list = [int(i) for i in range(2, N, 2)]
    for num in num_list:
        if di[num] != 2:
            break
    else:
        if A.count(0) == 1:
            ans = (2 ** (N // 2)) % (10 ** 9 + 7)

else:
    num_list = [int(i) for i in range(1, N, 2)]
    for i in num_list:
        if di[i] != 2:
            break
    else:
        ans = (2 ** (N // 2)) % (10 ** 9 + 7)
print(ans)
# Buggy code:
N = int(input())
A = sorted(list(map(int,input().split())))
mod = 10**9 + 7
B = []
if N % 2 == 0:
  for i in range(1, N//2 + 1):
    B.append(i*2 - 1)
    B.append(i*2 - 1)
else:
  for i in range(1, N//2 + 1):
    B.append(i*2)
    B.append(i*2)
  B.append(0)
B.sort()

if A != B:
  print(0)
else:
  if N % 2 == 0:
    print(pow(2, N//2), mod)
  else:
    print(pow(2, (N-1)//2), mod)

# Fixed code:
N = int(input())
A = list(map(int, input().split()))
A.sort()
B = []
mod = 10**9 + 7

if N % 2 == 0:
    for i in range(1, N, 2):
        B.append(i)
        B.append(i)
else:
    B.append(0)
    for i in range(2, N, 2):
        B.append(i)
        B.append(i)

if A != B:
    ans = 0
else:
    ans = 2 ** (N // 2) % mod

print(ans)
# Buggy code:
from  collections import Counter

n =int(input())

a = list(input().rstrip().split())

count_num = Counter(a)

result = True

if len(a) == n:
    if n % 2 == 0:
        for i in range(n-1, -1, -2):
            if count_num[str(i)] ==2:
                continue
            else:
                result = False
                break

    else:
        if count_num['0'] == 1:
            for i in range(n-1, 1, -2):                
                if count_num[str(i)] ==2:continue
                else:
                    result = False
                    break

if result: print(2**int(n/2) % (10**9+7))
else:print(0)
  

# Fixed code:
from  collections import Counter

n =int(input())

a = list(input().rstrip().split())

count_num = Counter(a)

result = True

if len(a) == n:
    if n % 2 == 0:
        for i in range(n-1, -1, -2):
            if count_num[str(i)] ==2:
                continue
            else:
                result = False
                break

    else:
        if count_num['0'] == 1:
            for i in range(n-1, 1, -2):                
                if count_num[str(i)] ==2:continue
                else:
                    result = False
                    break
        else:result=False

if result: print(2**int(n/2) % (10**9+7))
else:print(0)
# Buggy code:
from collections import Counter

n = int(input())
a = list(map(int, input().split()))
m = n//2
ca = Counter(a)
print(ca[0])

if n % 2 == 0 and all(ca[i*2 + 1] == 2 for i in range(m)):
    ans = (2 ** m) % (1e9 + 7)
    print(ans)
elif n % 2 == 1 and ca[0] == 1 and all(ca[(i+1)*2] == 2 for i in range(m)):
    ans = (2 ** m) % (1e9 + 7)
    print(ans)
else:
    print(0)


# Fixed code:

from collections import Counter

n = int(input())
a = list(map(int, input().split()))
m = n // 2
ca = Counter(a)

if n % 2 == 1 and ca[0] == 1 and all(ca[(i+1)*2] == 2 for i in range(m)):
    ans = (2 ** m) % (10 ** 9 + 7)
    print(ans)
elif n % 2 == 0 and all(ca[i*2 + 1] == 2 for i in range(m)):
    ans = (2 ** m) % (10 ** 9 + 7)
    print(ans)
else:
    print(0)
# Buggy code:
n = int(intput())

a = list(map(int,input().split()))

sa = sorted(a)

if n % 2 == 0:
  k = 0
else:
  k = 1

flag = True

for i,s in enumerate(sa):
  if (i/2)*2+k != s:
    flag = False

if flag:
  print(2**n/2)
else:
  print(0)


# Fixed code:
n = int(input()) 
a = list(map(int,input().split())) 
sa = sorted(a) 

if n % 2 == 0:
  k = 1
  l = 0
else:
  k = 0
  l = 1 

a=1000000007
flag = True 
for i,s in enumerate(sa):
  if ((i+l)//2)*2+k != s:
    flag = False
if flag:
  print(2**(n//2) % a)
else:
  print(0)
# Buggy code:
mod = 10 ** 7 + 1
N = int(input())
A = [int(a) for a in input().split()]
A.sort()

if N % 2 != 0:
    for i in range(0, N, 2):
        if A[i] != i:       
            print(0)
            exit()
    order_count = 2 ** ((N - 1) // 2) % mod

else:
    for i in range(1, N, 2):
        if A[i] != i + 1:
            print(0)
            exit()
    order_count = 2 ** (N // 2) % mod 

print(order_count)

# Fixed code:
mod = 10 ** 9 + 7
N = int(input())
A = [int(a) for a in input().split()]
A.sort()

if N % 2 != 0:
    if A[0] == 0:
        for i in range(2, N, 2):
            if not (A[i] == i and A[i-1] == i):
                print(0)
                exit()
        order_count = 2 ** ((N - 1) // 2) % mod
    else:
        print(0)
        exit()

else:
    for i in range(1, N, 2):
        if not (A[i] == i and A[i-1] == i):
            print(0)
            exit()
    order_count = 2 ** (N // 2) % mod 

print(order_count)
# Buggy code:
N = int(input())
A = list(map(int, input().split()))

ans = 0
A_test = sorted(list(set(A)))

if N % 2 == 1:
    judge = [i for i in range(0,N,2)]
    if A_test == judge:
        ans = 2**(N//2)
else:
    judge = [i for i in range(1,N,2)]
    if A_test == judge:
        ans = 2**(N//2)]

ans = ans % (10**9 + 7)
print(ans)


# Fixed code:
N = int(input())
A = list(map(int, input().split()))

ans = 0
A_test = sorted(list(set(A)))

if N % 2 == 1:
    judge = [i for i in range(0,N,2)]
    if (A_test == judge) and (A.count(0) == 1):
        ans = 2**(N//2)
else:
    judge = [i for i in range(1,N,2)]
    if A_test == judge:
        ans = 2**(N//2)

ans = ans % (10**9 + 7)
print(ans)
# Buggy code:
N = int(input().strip())
A = list(map(int, input().strip().split(' ')))
if N % 2 == 1:
  checklist = {0: 1}
  for i in range((N-2)//2):
    checklist[(i+1)*2] = 2
else:
  checklist = {(i*2+1):2 in i in range(N//2)}
  
for a in A:
  if a in checklist and checklist[a] in {1,2}:
    checklist[a] -= 1
  else:
    print(0)
    exit()
print(int(2**(N//2)))

# Fixed code:
N = int(input().strip())
A = list(map(int, input().strip().split(' ')))
if N % 2 == 1:
  checklist = {0:1}
  for i in range((N-1)//2):
    checklist[(i+1)*2] = 2
else:
  checklist = {(i*2+1):2 for i in range(N//2)}

for a in A:
  if a in checklist and checklist[a] in {1,2}:
    checklist[a] -= 1
  else:
    print(0)
    exit()
print(int(2**(N//2))%1000000007)
# Buggy code:
N = int(input())
A = sorted(list(map(int, input().split())), reverse=True)
n = N-1
for i in range(N//2):
  if A[2*i]!=n or A[2*i+1]!=n:
    print(0)
    exit()
  n -= 2
  
if N&1 and A[-1]!=1:
  print(0)
  exit()

print(1<<N//2)

# Fixed code:
N = int(input())
A = sorted(list(map(int, input().split())), reverse=True)
n = N-1
for i in range(N//2):
  if A[2*i]!=n or A[2*i+1]!=n:
    print(0)
    exit()
  n -= 2
  
if N&1 and A[-1]!=0:
  print(0)
  exit()

print((1<<N//2)%(10**9+7))
# Buggy code:
n = int(input())
m = list(map(int, input().split()))

l = {}
ll = {}

if n % 2 == 0:
  for i in m:
    l[2*(i//2)+1] = 2
    if i in ll:
      ll[i] += 1
    else:
      ll[i] = 1
else:
  for i in m:
    if 2*(i//2) == 0:
      l[2*(i//2)] = 1
    else:
      l[2*(i//2)] = 2
    if i in ll:
      ll[i] += 1
    else:
      ll[i] = 1

if l != ll:
  print(0)
  exit()

print(1 << (n // 2) / (10**9+7))


# Fixed code:
n = int(input())
m = list(map(int, input().split()))

l = {}
ll = {}

if n % 2 == 0:
  for i in m:
    l[2*(i//2)+1] = 2
    if i in ll:
      ll[i] += 1
    else:
      ll[i] = 1
else:
  for i in m:
    if 2*(i//2) == 0:
      l[2*(i//2)] = 1
    else:
      l[2*(i//2)] = 2
    if i in ll:
      ll[i] += 1
    else:
      ll[i] = 1

if l != ll:
  print(0)
  exit()

print((1 << (n // 2)) % ((10 ** 9) + 7))
# Buggy code:
from collections import Counter
n = int(input())
lst = [int(i) for i in input().split()]
mod = 10**9 + 7
lst_c = Counter(lst)
lst_c = sorted(lst_c.items(),key = lambda x:x[0])

ideal = []

if n%2!=0:
    ideal.append((0,1))
    for i in range(1,n//2+1):
        ideal.append((2*i,2))
else:
    for i in range(n//2):
        ideal.append((2*i+1,2))

if lst_c != ideal:
    print(0)
else:
    l = len(ideal)
    if n%2!=0:
        l -= 1
    print(2**l　% mod)



# Fixed code:
from collections import Counter
n = int(input())
lst = [int(i) for i in input().split()]
mod = 10**9 + 7
lst_c = Counter(lst)
lst_c = sorted(lst_c.items(),key = lambda x:x[0])

ideal = []

if n%2!=0:
    ideal.append((0,1))
    for i in range(1,n//2+1):
        ideal.append((2*i,2))
else:
    for i in range(n//2):
        ideal.append((2*i+1,2))

if lst_c != ideal:
    print(0)
else:
    l = len(ideal)
    if n%2!=0:
        l -= 1
    print(2**l % mod)
# Buggy code:
n = int(input())
a = list(map(int, input().split()))

def beki(n):
    ans = 1
    for _ in range(int(n)):
        ans = (ans * 2) % (10 ** 9 + 7)
    return int(ans)

if n % 2 == 0:
    hikaku = []
    for i in range(1, n, 2):
        hikaku += [i, i]
    if sorted(a) == hikaku:
        print(beki(n / 2))
    else:
        print(0)

elif n == 1:
    if a == [0]:
        print(1)
    else:
        print(0)
else:
    hikaku = []
    for i in range(n-1, 2):
        hikaku += []
    hikaku += [n-1]
    if sorted(a) == hikaku:
        print(beki((n - 1) / 2))
    else:
        print(0)

# Fixed code:
n = int(input())
a = list(map(int, input().split()))

def beki(n):
    ans = 1
    for _ in range(int(n)):
        ans = (ans * 2) % (10 ** 9 + 7)
    return int(ans)

if n % 2 == 0:
    hikaku = []
    for i in range(1, n, 2):
        hikaku += [i, i]
    if sorted(a) == hikaku:
        print(beki(n / 2))
    else:
        print(0)

elif n == 1:
    if a == [0]:
        print(1)
    else:
        print(0)
else:
    hikaku = [0]
    for i in range(2, n, 2):
        hikaku += [i, i]
    if sorted(a) == hikaku:
        print(beki((n - 1) / 2))
    else:
        print(0)
# Buggy code:
a, b, x = map(int, input().split())

print(b // x + 1 - a // x)

# Fixed code:
a,b,x = map(int,input().split())
ans = b//x - (a+x-1)//x + 1
print(ans)
# Buggy code:
ss = input()
a,b,x = ss.split()
ans = (int(b)-int(a)+1)//int(x)

print(ans)

# Fixed code:
ss = input()
a,b,x = ss.split()
ans = (int(b)//int(x)-(int(a)-1)//int(x))

print(ans)