Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
MOD = 10 * 9 + 7

flag = True

if 0 in A:
    if A.count(0) != 1:
        flag = False
S = set(A)
if 0 in S:
    S.remove(0)
flag = all(A.count(x) == 2 for x in S)

if flag:
    print(2 ** (N//2) % MOD)
else:
    print(0)


Fixed submission:
# 人数分布は一意
import numpy as np
MOD = 10**9 + 7
N = int(input())
A = np.array([int(x) for x in input().split()])

left = np.arange(N)
right = N-1-left
cnt_1 = np.bincount(np.abs(left-right))
cnt_2 = np.bincount(A)

if cnt_1.shape != cnt_2.shape or (cnt_1 != cnt_2).any():
    answer = 0
else:
    answer = pow(2, N//2, MOD)

print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
MOD = 10 * 9 + 7

flag = True

if 0 in A:
    if A.count(0) != 1:
        flag = False
S = set(A)
if 0 in S:
    S.remove(0)
flag = all(A.count(x) == 2 for x in S)

if flag:
    print(2 ** (N//2) % MOD)
else:
    print(0)


Fixed submission:
# 人数分布は一意
import numpy as np
MOD = 10**9 + 7
N = int(input())
A = np.array([int(x) for x in input().split()])

left = np.arange(N)
right = N-1-left
cnt_1 = np.bincount(np.abs(left-right))
cnt_2 = np.bincount(A)

if cnt_1.shape != cnt_2.shape or (cnt_1 != cnt_2).any():
    answer = 0
else:
    answer = pow(2, N//2, MOD)

print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
MOD = 10 * 9 + 7

flag = True

if 0 in A:
    if A.count(0) != 1:
        flag = False
S = set(A)
if 0 in S:
    S.remove(0)
flag = all(A.count(x) == 2 for x in S)

if flag:
    print(2 ** (N//2) % MOD)
else:
    print(0)


Fixed submission:
# 人数分布は一意
import numpy as np
MOD = 10**9 + 7
N = int(input())
A = np.array([int(x) for x in input().split()])

left = np.arange(N)
right = N-1-left
cnt_1 = np.bincount(np.abs(left-right))
cnt_2 = np.bincount(A)

if cnt_1.shape != cnt_2.shape or (cnt_1 != cnt_2).any():
    answer = 0
else:
    answer = pow(2, N//2, MOD)

print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
MOD = 10 * 9 + 7

flag = True

if 0 in A:
    if A.count(0) != 1:
        flag = False

for a in set(A):
    if a == 0:
        continue
    if A.count(a) != 2:
        flag = False
        break

if flag:
    print(2 ** (N//2) % MOD)
else:
    print(0)

Fixed submission:
# 人数分布は一意
import numpy as np
MOD = 10**9 + 7
N = int(input())
A = np.array([int(x) for x in input().split()])

left = np.arange(N)
right = N-1-left
cnt_1 = np.bincount(np.abs(left-right))
cnt_2 = np.bincount(A)

if cnt_1.shape != cnt_2.shape or (cnt_1 != cnt_2).any():
    answer = 0
else:
    answer = pow(2, N//2, MOD)

print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
MOD = 10 * 9 + 7

flag = True
s = set()

if 0 in A:
    if A.count(0) != 1:
        flag = False
    s.add(0)
for a in A:
    if a in s:
        continue
    if A.count(a) != 2:
        flag = False
        break
    s.add(a)

if flag:
    print(2 ** (N//2) % MOD)
else:
    print(0)

Fixed submission:
# 人数分布は一意
import numpy as np
MOD = 10**9 + 7
N = int(input())
A = np.array([int(x) for x in input().split()])

left = np.arange(N)
right = N-1-left
cnt_1 = np.bincount(np.abs(left-right))
cnt_2 = np.bincount(A)

if cnt_1.shape != cnt_2.shape or (cnt_1 != cnt_2).any():
    answer = 0
else:
    answer = pow(2, N//2, MOD)

print(answer)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
MOD = 10 * 9 + 7

flag = True

for i in range((N+1)%2, N, 2):
    if i == 0:
        if A.count(0) != 1:
            flag = False
    elif A.count(i) != 2:
        flag = False
if flag:
    print(2 ** (N//2) % MOD)
else:
    print(0)


Fixed submission:
# 人数分布は一意
import numpy as np
MOD = 10**9 + 7
N = int(input())
A = np.array([int(x) for x in input().split()])

left = np.arange(N)
right = N-1-left
cnt_1 = np.bincount(np.abs(left-right))
cnt_2 = np.bincount(A)

if cnt_1.shape != cnt_2.shape or (cnt_1 != cnt_2).any():
    answer = 0
else:
    answer = pow(2, N//2, MOD)

print(answer)