Problem: After the war, the supersonic rocket became the most common public transportation.

Each supersonic rocket consists of two "engines". Each engine is a set of "power sources". The first engine has n power sources, and the second one has m power sources. A power source can be described as a point (x_i, y_i) on a 2-D plane. All points in each engine are different.

You can manipulate each engine separately. There are two operations that you can do with each engine. You can do each operation as many times as you want.

  1. For every power source as a whole in that engine: (x_i, y_i) becomes (x_i+a, y_i+b), a and b can be any real numbers. In other words, all power sources will be shifted.
  2. For every power source as a whole in that engine: (x_i, y_i) becomes (x_i cos θ - y_i sin θ, x_i sin θ + y_i cos θ), θ can be any real number. In other words, all power sources will be rotated.



The engines work as follows: after the two engines are powered, their power sources are being combined (here power sources of different engines may coincide). If two power sources A(x_a, y_a) and B(x_b, y_b) exist, then for all real number k that 0 < k < 1, a new power source will be created C_k(kx_a+(1-k)x_b,ky_a+(1-k)y_b). Then, this procedure will be repeated again with all new and old power sources. After that, the "power field" from all power sources will be generated (can be considered as an infinite set of all power sources occurred).

A supersonic rocket is "safe" if and only if after you manipulate the engines, destroying any power source and then power the engine, the power field generated won't be changed (comparing to the situation where no power source erased). Two power fields are considered the same if and only if any power source in one field belongs to the other one as well.

Given a supersonic rocket, check whether it is safe or not.

Input

The first line contains two integers n, m (3 ≤ n, m ≤ 10^5) — the number of power sources in each engine.

Each of the next n lines contains two integers x_i and y_i (0≤ x_i, y_i≤ 10^8) — the coordinates of the i-th power source in the first engine.

Each of the next m lines contains two integers x_i and y_i (0≤ x_i, y_i≤ 10^8) — the coordinates of the i-th power source in the second engine.

It is guaranteed that there are no two or more power sources that are located in the same point in each engine.

Output

Print "YES" if the supersonic rocket is safe, otherwise "NO".

You can print each letter in an arbitrary case (upper or lower).

Examples

Input

3 4
0 0
0 2
2 0
0 2
2 2
2 0
1 1


Output

YES


Input

3 4
0 0
0 2
2 0
0 2
2 2
2 0
0 0


Output

NO

Note

The first sample:

<image> Those near pairs of blue and orange points actually coincide.

First, manipulate the first engine: use the second operation with θ = π (to rotate all power sources 180 degrees).

The power sources in the first engine become (0, 0), (0, -2), and (-2, 0).

<image>

Second, manipulate the second engine: use the first operation with a = b = -2.

The power sources in the second engine become (-2, 0), (0, 0), (0, -2), and (-1, -1).

<image>

You can examine that destroying any point, the power field formed by the two engines are always the solid triangle (0, 0), (-2, 0), (0, -2).

In the second sample, no matter how you manipulate the engines, there always exists a power source in the second engine that power field will shrink if you destroy it. 

Solution (in JAVA):

Solution:
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.InputMismatchException;

public class P1017E
{
	public static void main(String[] args)
	{
		FastScanner in = new FastScanner(System.in);
		int n = in.nextInt();
		int m = in.nextInt();
		ArrayList<Point> a = new ArrayList<>();
		while (n-->0)
			a.add(new Point(in.nextLong(), in.nextLong()));
		ArrayList<Delta> d1 = convexHull(a);
		ArrayList<Point> b = new ArrayList<>();
		while (m-->0)
			b.add(new Point(in.nextLong(), in.nextLong()));
		ArrayList<Delta> d2 = convexHull(b);
		for (int i = 0; i < 4; i++) {
			if (i > 0)
				rotate(d1);
			if (isRotation(d1, d2)) {
				System.out.println("YES");
				return;
			}
		}
		System.out.println("NO");
	}
	
	public static void rotate(ArrayList<Delta> list)
	{
		for (Delta d : list)
			d.rotate();
	}
	
	public static boolean isRotation(ArrayList<Delta> d1, ArrayList<Delta> d2)
	{
		if (d1.size() != d2.size())
			return false;
		int[] prefixes = new int[d1.size()];
		for (int i = 1, j = 0; i < d1.size(); i++) {
			while (j > 0 && !d1.get(i).equals(d1.get(j)))
				j = prefixes[j - 1];
			if (d1.get(i).equals(d1.get(j)))
				j++;
			prefixes[i] = j;
		}
		int i = 0, j = 0;
		for (; i < d2.size(); i++) {
			while (j > 0 && !d2.get(i).equals(d1.get(j)))
				j = prefixes[j - 1];
			if (d2.get(i).equals(d1.get(j)))
				j++;
		}
		for (i = 0; i < d2.size(); i++) {
			if (j >= d1.size())
				return true;
			while (j > 0 && !d2.get(i).equals(d1.get(j)))
				j = prefixes[j - 1];
			if (d2.get(i).equals(d1.get(j)))
				j++;
		}
		return false;
	}
	
	public static ArrayList<Delta> convexHull(ArrayList<Point> pts)
	{
		int ind = 0;
		Point min = pts.get(ind);
		for (int i = 1; i < pts.size(); i++) {
			Point cmp = pts.get(i);
			if (cmp.y < min.y || cmp.y == min.y && cmp.x < min.x) {
				ind = i;
				min = cmp;
			}
		}
		pts.remove(ind);
		for (Point p : pts) {
			long dx = p.x - min.x;
			long dy = p.y - min.y;
			p.angle = Math.atan2(dy, dx);
			p.d2 = dx * dx + dy * dy;
		}
		Collections.sort(pts);
		ArrayList<Point> hull = new ArrayList<>();
		hull.add(min);
		for (Point p : pts) {
			if (hull.size() > 1 && p.angle == hull.get(hull.size() - 1).angle)
				continue;
			hull.add(p);
			while (hull.size() > 2 && ccw(hull) <= 0)
				hull.remove(hull.size() - 2);
		}
		ArrayList<Delta> ret = new ArrayList<>();
		for (int i = 0; i < hull.size(); i++) {
			int j = (i + 1) % hull.size();
			ret.add(new Delta(hull.get(j).x - hull.get(i).x, hull.get(j).y - hull.get(i).y));
		}
		return ret;
	}
	
	/**
	 * Three points are a counter-clockwise turn if ccw > 0, clockwise if
	 * ccw < 0, and collinear if ccw = 0 because ccw is a determinant that
	 * gives twice the signed area of the triangle formed by p1, p2 and p3.
	 */
	public static long ccw(ArrayList<Point> hull)
	{
		Point p1 = hull.get(hull.size() - 3);
		Point p2 = hull.get(hull.size() - 2);
		Point p3 = hull.get(hull.size() - 1);
		return (p2.x - p1.x) * (p3.y - p1.y) - (p2.y - p1.y) * (p3.x - p1.x);
	}
	
	public static class Point implements Comparable<Point>
	{
		long x;
		long y;
		double angle;
		long d2;
		
		public Point(long a, long b)
		{
			x = a;
			y = b;
		}
		
		public int compareTo(Point o)
		{
			if (this.angle != o.angle)
				return this.angle < o.angle ? -1 : 1;
			return o.d2 < this.d2 ? -1 : 1;
		}
		
		public String toString()
		{
			return x + " " + y;
		}
	}
	
	public static class Delta
	{
		long dx;
		long dy;
		
		public Delta(long a, long b)
		{
			dx = a;
			dy = b;
		}
		
		public void rotate()
		{
			long temp = dx;
			dx = -dy;
			dy = temp;
		}
		
		public String toString()
		{
			return dx + " " + dy;
		}
		
		public boolean equals(Delta o)
		{
			return this.dx == o.dx && this.dy == o.dy;
		}
	}
	
	/**
	 * Source: Matt Fontaine
	 */
	public static class FastScanner
	{
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

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

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

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

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

		public int nextInt()
		{
			return Integer.parseInt(next());
		}

		public long nextLong()
		{
			return Long.parseLong(next());
		}

		public double nextDouble()
		{
			return Double.parseDouble(next());
		}

		public String next()
		{
			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 (isEndline(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do
			{
				res.appendCodePoint(c);
				c = read();
			} while (!isEndline(c));
			return res.toString();
		}
	}
}