//prepisivaci
using System;

namespace zad3
{
    class Program
    {
        static void Main()
        {
            int N = int.Parse(System.Console.ReadLine());
            int[] x = new int[N];
            int[] y = new int[N];
            int i;
            string[] tokens = new string[2];
            for ( i = 0; i < N; i++)
            {
                tokens = Console.ReadLine().Split(' ');
                x[i] = int.Parse(tokens[0]);
                y[i] = int.Parse(tokens[1]);

            }
            int a, b,k;
            //for (int i = 0; i < N; i++)
            //{
            i = 0;
                a = x[i + 1] - x[i];
                b = x[i + 2] - x[i+3];
            //}
            //Console.WriteLine(a.ToString());
            //Console.WriteLine(b.ToString());
            if (a == b * 2)
            {
                k = 1;
                Console.WriteLine(k.ToString());
            }
            Console.ReadKey();
        }
    }
}