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.util.*;

import java.io.*;

public class K {

	static int n, k, x;
	static long memo[][];
	static int[] a;

	static long dp(int s, int l) {
		if (s == x) {
			if (n - l - 1 >= k) {
				return (long) (-1 * 1e16);
			}
			return 0;
		}
		if (l == n - 1)
			return (long) (-1 * 1e16);

		if (memo[s][l] != -2)
			return memo[s][l];
		long max = (long) (-1 * 1e16);
		for (int i = l + 1; i <= l + k && i < n; i++) {
			max = Math.max(max, dp(s + 1, i) + a[i]);
		}
		return memo[s][l] = max;
	}

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);
		int n = Integer.parseInt(br.readLine());
		pair[] a = new pair[n];
		for (int i = 0; i < a.length; i++) {
			StringTokenizer st = new StringTokenizer(br.readLine());
			int x = Integer.parseInt(st.nextToken());
			int y = Integer.parseInt(st.nextToken());
			a[i] = new pair(x, y);
		}
		if (n % 2 == 0) {
			boolean f = true;
			for (int i = 1; i < n; i++) {
				pair a1 = a[i - 1];
				pair a2 = a[i];
				int idx = (i + n / 2) % n;
				int idy = (i - 1 + n / 2) % n;

				if (slope(a1, a2) - slope(a[idx], a[idy]) > eps)
					f = false;

				if (dist(a1, a2) - dist(a[idx], a[idy]) > eps)
					f = false;
			}

			if (f)
				pw.println("YES");
			else
				pw.println("NO");
		} else
			pw.println("NO");

		pw.flush();

	}

	static double slope(pair p1, pair p2) {
		return (p1.y - p2.y) * 1.0 / (p1.x - p2.x);
	}

	static double eps = 1e-9;

	static boolean ckeck(pair[] a, pair[] p) {
		double df = dist(a[0], a[1]) / dist(p[0], p[1]);
		for (int i = 1; i < p.length; i++) {
			pair p1 = p[i - 1];
			pair p2 = p[i];
			pair p3;
			if (i == a.length)
				p3 = p[0];
			else
				p3 = p[i + 1];
			pair a1 = a[i - 1];
			pair a2 = a[i];
			pair a3;
			if (i == a.length)
				a3 = a[0];
			else
				a3 = a[i + 1];
			double r = dist(a2, a3) / dist(p2, p3);
			if (r - df > eps)
				return false;
			double ang1 = angle(a1, a2, a3);
			double ang2 = angle(p1, p2, p3);

			if (ang1 - ang2 > eps)
				return false;
		}
		return true;
	}

	static double angle(pair a, pair o, pair b) // angle AOB
	{
		Vector oa = new Vector(o, a), ob = new Vector(o, b);
		return Math.acos(oa.dot(ob) / Math.sqrt(oa.norm2() * ob.norm2()));
	}

	public static double dist(pair p, pair a) {
		return Math.sqrt(sq(a.x - p.x) + sq(a.y - p.y));
	}

	static double sq(double x) {
		return x * x;
	}

	static class Vector {

		double x, y;

		Vector(double a, double b) {
			x = a;
			y = b;
		}

		Vector(pair a, pair b) {
			this(b.x - a.x, b.y - a.y);
		}

		Vector scale(double s) {
			return new Vector(x * s, y * s);
		} // s is a non-negative value

		double dot(Vector v) {
			return (x * v.x + y * v.y);
		}

		double cross(Vector v) {
			return x * v.y - y * v.x;
		}

		double norm2() {
			return x * x + y * y;
		}

		Vector reverse() {
			return new Vector(-x, -y);
		}

		Vector normalize() {
			double d = Math.sqrt(norm2());
			return scale(1 / d);
		}
	}

	static class pair implements Comparable<pair> {
		int x;
		int y;

		public pair(int d, int l) {
			x = d;
			y = l;
		}

		@Override
		public int compareTo(pair arg0) {
			// TODO Auto-generated method stub
			if (x == arg0.x) {
				return (int) (y - arg0.y);
			}
			return x - arg0.x;
		}
	}

}
