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

public class A {
	
	final static boolean debug=false;
	
	public static void main(String[] args) {
		FastScanner fs=new FastScanner();
		int n1=fs.nextInt(), n2=fs.nextInt();
		Vec[] vecs1=new Vec[n1], vecs2=new Vec[n2];
		for (int i=0; i<n1; i++)
			vecs1[i]=new Vec(fs.nextInt(), fs.nextInt());
		for (int i=0; i<n2; i++)
			vecs2[i]=new Vec(fs.nextInt(), fs.nextInt());
		ArrayList<Vec> h1=getHull(vecs1);
		ArrayList<Vec> h2=getHull(vecs2);
		if (debug) System.out.println(h1);
		if (debug) System.out.println(h2);
		if (h1.size()!=h2.size()) {
			System.out.println("NO");
			return;
		}
		long[][] h1Parts=getParts(h1), h2Parts=getParts(h2);
		for (int i=0; i<h1Parts.length; i++) {
			if (debug) System.out.println(h1Parts[i][0]+" "+h1Parts[i][1]);
		}
		if (debug) System.out.println();
		for (int i=0; i<h2Parts.length; i++) {
			if (debug) System.out.println(h2Parts[i][0]+" "+h2Parts[i][1]);
		}
		if (works(h1Parts, h2Parts)) {
			System.out.println("YES");
		}
		else {
			System.out.println("NO");
		}
	}
	
	public static long[][] getParts(ArrayList<Vec> hull) {
		int n=hull.size();
		long[][] toReturn=new long[n][2];
		for (int i=0; i<n; i++) {
			Vec v1=hull.get((i+1)%n).sub(hull.get(i));
			Vec v2=hull.get((i+2)%n).sub(hull.get((i+1)%n));
			
			toReturn[i][0]=v1.sub(v2).mag2();
			toReturn[i][1]=v1.cross(v2);
		}
		return toReturn;
	}
	
	private static boolean works(long[][] h1, long[][] h2) {
		int n=h1.length;
		long[][] full=new long[n+1+n+n][2];
		for (int i=0; i<n; i++) {
			full[i]=h1[i];
			full[n+1+i]=full[n+1+n+i]=h2[i];
		}
		full[n]=new long[] {-999999999999999l, -999999999999999l};
		int[] zVals=zValues(full);
		if (debug) System.out.println("z: "+Arrays.toString(zVals));
		for (int i=n; i<zVals.length; i++)
			if (zVals[i]>=n) return true;
		return false;
	}
	
	public static int[] zValues(long[][] s) {
	int n = s.length; 
	int[] z = new int[n];  z[0] = n;
	int L = 0, R = 0;
	int[] left = new int[n], right = new int[n];
	for(int i = 1; i < n; ++i) {
		if(i > R) {
			L = R = i;
			while(R < n && s[R-L][0] == s[R][0] && s[R-L][1] == s[R][1]) R++;
			z[i] = R - L;  R--;
		} else {
			int k = i-L;
			if(z[k] < R-i+1) z[i] = z[k];
			else {
				L = i;
				while(R < n && s[R-L][0] == s[R][0] && s[R-L][1]== s[R-L][1]) R++;
				z[i] = R - L;  R--;
			}
		}
		left[i] = L;  right[i] = R;
	}
	return z;
}
	
	// Returns the convex hull in COUNTER-CLOCKWISE order.  Vector: Compare X then Y.
public static ArrayList<Vec> getHull(Vec[] ps) {
    ArrayList<Vec> s = new ArrayList<>();
	for (Vec v:ps) s.add(v);
    Collections.sort(s);
    
    int n = s.size(), j = 2, k = 2;

    Vec[] lo = new Vec[n], up = new Vec[n];
    lo[0] = s.get(0);  lo[1] = s.get(1);
                
    for (int i = 2; i < n; i++) {
        Vec p = s.get(i);
        while (j > 1 && !RT(lo[j - 2], lo[j - 1], p))  j--;
        lo[j++] = p;
    }
                
    up[0] = s.get(n - 1);  up[1] = s.get(n - 2);

    for (int i = n - 3; i >= 0; i--) { // note difference
        Vec p = s.get(i);
        while (k > 1 && !RT(up[k - 2], up[k - 1], p))  k--;
        up[k++] = p;
    }
                
    ArrayList<Vec> res = new ArrayList<Vec>();
    for (int i = 0; i < k; i++) res.add(up[i]);
    for (int i = 1; i < j - 1; i++) res.add(lo[i]);

    return res;
}
static boolean RT(Vec a, Vec b, Vec c) { return b.sub(a).cross(c.sub(a)) > 0; }

	
	private static class Vec implements Comparable<Vec> {
		long x, y;
		public Vec(long x, long y) {
			this.x=x;
			this.y=y;
		}
		public Vec add(Vec o) {
			return new Vec(x+o.x, y+o.y);
		}
		
		public Vec scale(long s) {
			return new Vec(x*s, y*s);
		}
		
		public Vec sub(Vec o) {
			return add(o.scale(-1));
		}
		
		public long mag2() {
			return x*x+y*y;
		}
		
		public long dot(Vec o) {
			return x*o.x+y*o.y;
		}
		
		public long cross(Vec o) {
			return x*o.y-y*o.x;
		}
		
		public double angle() {
			return Math.atan2(y, x);
		}
		
		public int compareTo(Vec o) {
			if (x!=o.x)
				return Long.compare(x, o.x);
			return Long.compare(y, o.y);
		}
		
		public String toString() {
			return "("+x+", "+y+")";
		}
	}
	
	private static class FastScanner {
		BufferedReader br;
		StringTokenizer st;
		public FastScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
		int nextInt() {
			return Integer.parseInt(next());
		}
		long nextLong() {
			return Long.parseLong(next());
		}
		double nextDouble() {
			return Double.parseDouble(next());
		}
		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++)
				a[i]=nextInt();
			return a;
		}
		long[] readLongArray(int n) {
			long[] a=new long[n];
			for (int i=0; i<n; i++)
				a[i]=nextLong();
			return a;
		}
	}
}