Guy-Manuel and Thomas are going to build a polygon spaceship.

You're given a strictly convex (i. e. no three points are collinear) polygon P which is defined by coordinates of its vertices. Define P(x,y) as a polygon obtained by translating P by vector \overrightarrow {(x,y)}. The picture below depicts an example of the translation:

<image>

Define T as a set of points which is the union of all P(x,y) such that the origin (0,0) lies in P(x,y) (both strictly inside and on the boundary). There is also an equivalent definition: a point (x,y) lies in T only if there are two points A,B in P such that \overrightarrow {AB} = \overrightarrow {(x,y)}. One can prove T is a polygon too. For example, if P is a regular triangle then T is a regular hexagon. At the picture below P is drawn in black and some P(x,y) which contain the origin are drawn in colored: 

<image>

The spaceship has the best aerodynamic performance if P and T are similar. Your task is to check whether the polygons P and T are [similar](https://tinyurl.com/vp5m7vl).

Input

The first line of input will contain a single integer n (3 ≤ n ≤ 10^5) — the number of points.

The i-th of the next n lines contains two integers x_i, y_i (|x_i|, |y_i| ≤ 10^9), denoting the coordinates of the i-th vertex.

It is guaranteed that these points are listed in counterclockwise order and these points form a strictly convex polygon.

Output

Output "YES" in a separate line, if P and T are similar. Otherwise, output "NO" in a separate line. You can print each letter in any case (upper or lower).

Examples

Input


4
1 0
4 1
3 4
0 3


Output


YES

Input


3
100 86
50 0
150 0


Output


nO

Input


8
0 0
1 0
2 1
3 3
4 6
3 6
2 5
1 3


Output


YES

Note

The following image shows the first sample: both P and T are squares. The second sample was shown in the statements.

<image>
import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.net.Inet4Address;
import java.util.*;
import java.lang.*;
import java.util.HashMap;
import java.util.PriorityQueue;
public class Solution implements Runnable
{
    static class pairr
    {
        long f;
        long s;
        pairr(long ff,long ss)
        {
            f=ff;
            s=ss;
        }
    }
    static class pair implements Comparable
    {
        int f;
        int s;
        pair(int fi, int se)
        {
            f=fi;
            s=se;
        }
        public int compareTo(Object o)//asc order
        {
            pair pr=(pair)o;
            if(s>pr.s)
                return 1;
            if(s==pr.s)
            {
                if(f>pr.f)
                    return 1;
                else
                    return -1;
            }
            else
                return -1;
        }
        public boolean equals(Object o)
        {
            pair ob=(pair)o;
            if(o!=null)
            {
                if((ob.f==this.f)&&(ob.s==this.s))
                    return true;
            }
            return false;
        }
        public int hashCode()
        {
            return (this.f+" "+this.s).hashCode();
        }
    }
    public class triplet implements Comparable
    {
        int f;
        int s;
        int t;
        triplet(int f,int s,int t)
        {
            this.f=f;
            this.s=s;
            this.t=t;
        }
        public boolean equals(Object o)
        {
            triplet ob=(triplet)o;
            if(o!=null)
            {
                if((ob.f==this.f)&&(ob.s==this.s)&&(ob.t==this.t))
                    return true;
            }
            return false;
        }
        public int hashCode()
        {
            return (this.f+" "+this.s+" "+this.t).hashCode();
        }
        public int compareTo(Object o)//asc order
        {
            triplet tr=(triplet)o;
            if(t>tr.t)
                return 1;
            else
                return -1;
        }
    }
    void merge1(int arr[], int l, int m, int r)
    {
        int n1 = m - l + 1;
        int n2 = r - m;
        int L[] = new int [n1];
        int R[] = new int [n2];
        for (int i=0; i<n1; ++i)
            L[i] = arr[l + i];
        for (int j=0; j<n2; ++j)
            R[j] = arr[m + 1+ j];
        int i = 0, j = 0;
        int k = l;
        while (i < n1 && j < n2)
        {
            if (L[i]<=R[j])
            {
                arr[k] = L[i];
                i++;
            }
            else
            {
                arr[k] = R[j];
                j++;
            }
            k++;
        }
        while (i < n1)
        {
            arr[k] = L[i];
            i++;
            k++;
        }
        while (j < n2)
        {
            arr[k] = R[j];
            j++;
            k++;
        }
    }
    void sort1(int arr[], int l, int r)
    {
        if (l < r)
        {
            int m = (l+r)/2;
            sort1(arr, l, m);
            sort1(arr , m+1, r);
            merge1(arr, l, m, r);
        }
    }
    long gcd(long x,long y)
    {
        if(x%y==0)
            return y;
        else
            return(gcd(y,x%y));
    }
    long calcdist(long x1,long y1,long x2,long y2)
    {
        return ((x2-x1)*(x2-x1))+((y2-y1)*(y2-y1));
    }
    pairr calcslope(long x1,long y1,long x2,long y2)
    {
        long y=y2-y1;
        long x=x2-x1;
        if(x==0 && y!=0)
        {
            return new pairr(0,1);
        }
        else if(x!=0 && y==0)
        {
            return new pairr(1,0);
        }
        else
        {
            long g=gcd(x,y);
            return new pairr(x/g,y/g);
        }
    }
    public static void main(String args[])throws Exception
    {
        new Thread(null,new Solution(),"Solution",1<<27).start();
    }
    public void run()
    {
        try
        {
            InputReader in = new InputReader(System.in);
            PrintWriter out = new PrintWriter(System.out);
            int n=in.ni();
            long x[]=new long[n+2];
            long y[]=new long[n+2];
            for(int i=1;i<=n;i++)
            {
                x[i]=in.nl();
                y[i]=in.nl();
            }
            x[n+1]=x[1];
            y[n+1]=y[1];
            if(n%2==1)
                out.println("NO");
            else
            {
                int k=0;
                for(int i=1;i<=n/2;i++)
                {
                    long x1=x[i];
                    long y1=y[i];
                    long x2=x[i+1];
                    long y2=y[i+1];
                    long x11=x[i+n/2+1];
                    long y11=y[i+n/2+1];
                    long x22=x[i+n/2];
                    long y22=y[i+n/2];
                    long dist1=calcdist(x1,y1,x2,y2);
                    long dist2=calcdist(x11,y11,x22,y22);
                    pairr slope1=calcslope(x1,y1,x2,y2);
                    pairr slope2=calcslope(x11,y11,x22,y22);
                    if(dist1==dist2 && slope1.f==slope2.f && slope1.s==slope2.s)
                        continue;
                    k=1;
                    break;
                }
                if(k==1)
                    out.println("NO");
                else
                    out.println("YES");
            }
            out.close();
        }
        catch(Exception e){
            System.out.println(e);
        }
    }
    static class InputReader {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int ni() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nl() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = ni();
            }
            return a;
        }

        public String readString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

    }
}