Пример #1
0
        void Solve(StreamScanner ss, StreamWriter sw)
        {
            //---------------------------------
            var N = ss.Next(int.Parse);
            var A = ss.Next(long.Parse, N).OrderBy(x => x).ToArray();

            for (var i = 0; i < N; i++)
            {
                if (A[i] == (N % 2 == 0 ? i + 1 - i % 2 : i + i % 2))
                {
                    continue;
                }
                sw.WriteLine(0);
                return;
            }

            sw.WriteLine(new ModInt(2).Pow(N / 2));
            //---------------------------------
        }