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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        MyScan in = new MyScan(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskE solver = new TaskE();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskE {
        public void solve(int testNumber, MyScan in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();

            long[][] l1 = in.nl(n, 2);
            long[][] l2 = in.nl(m, 2);


            l1 = ConvexHull.calculate(l1);
            l2 = ConvexHull.calculate(l2);

//        out.println(Arrays.deepToString(l1));
//        out.println(Arrays.deepToString(l2));
            if (l1.length != l2.length) {
                out.println("NO");
                return;
            }

            String x1 = p(l1);
            String x2 = p(l2);


            KMP kmp = new KMP(x1);

//        out.println(x1);
//        out.println(x2);
//        out.println(s11);
//        out.println(s21);
            int f1 = kmp.match(x2 + x2);
            if (f1 >= 0) {
                out.println("YES");
            } else {
                out.println("NO");
            }

        }

        private String p(long[][] l1) {

            StringBuilder stringBuilder = new StringBuilder();
            for (int t = 0; t < l1.length; t++) {
                app(stringBuilder, l1, t, t + 1);
                stringBuilder.append(":");
                app(stringBuilder, l1, t, t + 2);
            }
            return stringBuilder.toString();

        }

        private void app(StringBuilder stringBuilder, long[][] l1, int s1, int s2) {
            stringBuilder.append(Geo.lens(l1[s1 % l1.length], l1[s2 % l1.length])).append(' ');
        }

    }

    static class Geo {
        public static long lens(long[] p1, long[] p2) {
            return (p1[0] - p2[0]) * (p1[0] - p2[0]) + (p1[1] - p2[1]) * (p1[1] - p2[1]);
        }

    }

    static class KMP {
        private final int[] lcs;
        private final String s2;

        public KMP(String s2) {
            lcs = lcs(s2);
            this.s2 = s2;
        }

        public int match(String s1) {
            int i = 0;
            int j = 0;
            while (i < s1.length()) {
                if (s2.charAt(j) == s1.charAt(i)) {
                    i++;
                    j++;
                }
                if (j == s2.length()) {
                    return i;
                } else if (i < s1.length() && s2.charAt(j) != s1.charAt(i)) {
                    if (j != 0) {
                        j = lcs[j - 1];
                    } else {
                        i++;
                    }
                }
            }
            return -1;
        }

        private int[] lcs(String t) {
            int[] lps = new int[t.length()];
            int i = 1;
            int len = 0;
            while (i < t.length()) {
                if (t.charAt(i) == t.charAt(len)) {
                    lps[i++] = ++len;
                } else {
                    if (len != 0) {
                        len = lps[len - 1];
                    } else {
                        lps[i++] = 0;
                    }
                }
            }
            return lps;
        }

    }

    static class ConvexHull {
        public static long[][] calculate(long[][] co) {
            int n = co.length;
            if (n <= 1) return co;
            Arrays.sort(co, (a, b) -> {
                if (a[0] != b[0]) return Long.compare(a[0], b[0]);
                return Long.compare(a[1], b[1]);
            });

            int[] inds = new int[n + 1];
            int p = 0;
            for (int i = 0; i < n; i++) {
                if (p >= 1 && co[inds[p - 1]][0] == co[i][0] && co[inds[p - 1]][1] == co[i][1]) continue;
                while (p >= 2 && ccw(co[inds[p - 2]], co[inds[p - 1]], co[i]) >= 0) p--; // if you need point on line
                inds[p++] = i;
            }

            int inf = p + 1;
            for (int i = n - 2; i >= 0; i--) {
                if (co[inds[p - 1]][0] == co[i][0] && co[inds[p - 1]][1] == co[i][1]) continue;
                while (p >= inf && ccw(co[inds[p - 2]], co[inds[p - 1]], co[i]) >= 0) p--; // if you need point on line
                inds[p++] = i;
            }

            int len = Math.max(p - 1, 1);
            long[][] ret = new long[len][];
            for (int i = 0; i < len; i++) ret[i] = co[inds[i]];
            return ret;
        }

        public static int ccw(long[] a, long[] b, long[] t) {
            return Long.signum((t[0] - a[0]) * (b[1] - a[1]) - (b[0] - a[0]) * (t[1] - a[1]));
        }

    }

    static class MyScan {
        private final InputStream in;
        private byte[] inbuf = new byte[1024];
        public int lenbuf = 0;
        public int ptrbuf = 0;

        public MyScan(InputStream in) {
            this.in = in;
        }

        private int readByte() {
            if (lenbuf == -1) throw new InputMismatchException();
            if (ptrbuf >= lenbuf) {
                ptrbuf = 0;
                try {
                    lenbuf = in.read(inbuf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (lenbuf <= 0) return -1;
            }
            return inbuf[ptrbuf++];
        }

        public long[][] nl(int m, int i) {
            long[][] r = new long[m][];
            for (int s = 0; s < m; s++) {
                r[s] = nl(i);
            }
            return r;
        }

        public long[] nl(int n) {
            long[] k = new long[n];
            for (int i = 0; i < n; i++) {
                k[i] = nextLong();
            }
            return k;
        }

        public int nextInt() {
            int num = 0, b;
            boolean minus = false;
            while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
            if (b == '-') {
                minus = true;
                b = readByte();
            }

            while (true) {
                if (b >= '0' && b <= '9') {
                    num = num * 10 + (b - '0');
                } else {
                    return minus ? -num : num;
                }
                b = readByte();
            }
        }

        public long nextLong() {
            long num = 0;
            int b;
            boolean minus = false;
            while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
            if (b == '-') {
                minus = true;
                b = readByte();
            }

            while (true) {
                if (b >= '0' && b <= '9') {
                    num = num * 10 + (b - '0');
                } else {
                    return minus ? -num : num;
                }
                b = readByte();
            }
        }

    }
}