There is a matrix A of size x × y filled with integers. For every <image>, <image> Ai, j = y(i - 1) + j. Obviously, every integer from [1..xy] occurs exactly once in this matrix. 

You have traversed some path in this matrix. Your path can be described as a sequence of visited cells a1, a2, ..., an denoting that you started in the cell containing the number a1, then moved to the cell with the number a2, and so on.

From the cell located in i-th line and j-th column (we denote this cell as (i, j)) you can move into one of the following cells:

  1. (i + 1, j) — only if i < x; 
  2. (i, j + 1) — only if j < y; 
  3. (i - 1, j) — only if i > 1; 
  4. (i, j - 1) — only if j > 1.



Notice that making a move requires you to go to an adjacent cell. It is not allowed to stay in the same cell. You don't know x and y exactly, but you have to find any possible values for these numbers such that you could start in the cell containing the integer a1, then move to the cell containing a2 (in one step), then move to the cell containing a3 (also in one step) and so on. Can you choose x and y so that they don't contradict with your sequence of moves?

Input

The first line contains one integer number n (1 ≤ n ≤ 200000) — the number of cells you visited on your path (if some cell is visited twice, then it's listed twice).

The second line contains n integers a1, a2, ..., an (1 ≤ ai ≤ 109) — the integers in the cells on your path.

Output

If all possible values of x and y such that 1 ≤ x, y ≤ 109 contradict with the information about your path, print NO.

Otherwise, print YES in the first line, and in the second line print the values x and y such that your path was possible with such number of lines and columns in the matrix. Remember that they must be positive integers not exceeding 109.

Examples

Input

8
1 2 3 6 9 8 5 2


Output

YES
3 3


Input

6
1 2 1 2 5 3


Output

NO


Input

2
1 10


Output

YES
4 9

Note

The matrix and the path on it in the first test looks like this:

<image>

Also there exist multiple correct answers for both the first and the third examples.
import java.io.*;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.Set;

public class MatrixWalk
{
    public static void main(String[] args)
    {
        new MatrixWalk(System.in, System.out);
    }

    static class Solver implements Runnable
    {
        int n;
        int[] arr;
        //		BufferedReader in;
        InputReader in;
        PrintWriter out;

        void solve()
        {
            n = in.nextInt();
            arr = in.nextIntArray(n);

            if (consecutive(arr))
            {
                out.println("YES\n1 " + arr[n - 1]);

                return;
            }

            int ptr = 1;

            while (ptr < n && arr[ptr] == arr[ptr - 1] + 1)
                ptr++;

            Set<Integer> set = new HashSet<>();

            for (int i = 1; i < n; i++)
                set.add(Math.abs(arr[i] - arr[i - 1]));

            if (set.size() > 2 || set.contains(0))
            {
                out.println("NO");

                return;
            }

            set.remove(1);

            if (set.size() == 0)
            {
                out.println("YES");
                out.println((int) 1e9 + " " + 1);

                return;
            }

            int max = 0;

            for (int i = 0; i < n; i++)
                max = Math.max(max, arr[i]);

            boolean valid = true;
            int cols = set.iterator().next();

            for (int i = 1; i < n; i++)
            {
                if (!poss(arr[i], arr[i - 1], cols))
                {
                    valid = false;

                    break;
                }
            }

            if (!valid)
            {
                out.println("NO");

                return;
            }

            out.println("YES");
            out.println((int) 1e9 + " " + cols);

/*            int cols;

            if (arr[ptr] > arr[ptr - 1])
                cols = arr[ptr] - arr[ptr - 1];
            else
                cols = arr[ptr - 1] - arr[ptr];

            if (cols == 0)
            {
                System.out.println("cols == 0.");
                out.println("NO");

                return;
            }

            boolean valid = true;
            System.out.println("cols : " + cols);

            for (int i = 1; i < n; i++)
            {
                if (Math.abs(arr[i] - arr[i - 1]) != 1 && Math.abs(arr[i] - arr[i - 1]) != cols)
                {
                    System.out.println("i : " + i + ", arr[i] : " + arr[i] + ", arr[i - 1] : " + arr[i - 1]);
                    valid = false;

                    break;
                }

                if (!poss(arr[i], arr[i - 1], cols))
                {
                    System.out.println("not poss for " + arr[i] + ", " + arr[i - 1]);
                    valid = false;

                    break;
                }
            }*/

/*            if (!valid)
                out.println("NO");
            else
            {
                int max = arr[0];

                for (int i = 1; i < n; i++)
                    max = Math.max(max, arr[i]);

                int rows = (int) Math.ceil((double) max / cols);

                out.println("YES");
                out.println(rows + " " + cols);
            }*/
        }

        boolean consecutive(int[] arr)
        {
            int n = arr.length;

            for (int i = 1; i < n; i++)
            {
                if (arr[i] != arr[i - 1] + 1)
                    return false;
            }

            return true;
        }

        boolean poss(int a, int b, int cols)
        {
            if (a > b)
            {
                int temp = a;

                a = b;
                b = temp;
            }

            if (a % cols == 0)
                return b == a + cols;
            else
                return a == b - 1 || a == b - cols;
        }

        public Solver(InputReader in, PrintWriter out)
        {
            this.in = in;
            this.out = out;
        }

        @Override
        public void run()
        {
            solve();
        }

    }

    static class InputReader
    {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public 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++];
        }

        public int nextInt()
        {
            int c = read();

            while (isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-')
            {
                sgn = -1;
                c = read();
            }

            int res = 0;

            do
            {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();

                res *= 10;
                res += c & 15;

                c = read();
            } while (!isSpaceChar(c));

            return res * sgn;
        }

        public int[] nextIntArray(int arraySize)
        {
            int array[] = new int[arraySize];

            for (int i = 0; i < arraySize; i++)
                array[i] = nextInt();

            return array;
        }

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

        public void close()
        {
            try
            {
                stream.close();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
        }

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

    }

    public MatrixWalk(InputStream inputStream, OutputStream outputStream)
    {
//		uncomment below line to change to BufferedReader
//		BufferedReader in = new BufferedReader(new InputStreamReader(inputStream));
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Thread thread = new Thread(null, new Solver(in, out), "MatrixWalk", 1 << 29);

        try
        {
            thread.start();
            thread.join();
        }
        catch (InterruptedException e)
        {
            e.printStackTrace();
        }
        finally
        {
            in.close();
            out.flush();
            out.close();
        }
    }

}

/*

5
1 2 3 6 7

50
491503404 491503403 491503402 419833805 348164208 419833805 419833804 419833803 348164206 348164205 348164206 348164205 348164204 276494607 276494608 276494609 204825012 133155415 133155414 61485817 61485816 133155413 204825010 204825011 204825010 204825011 204825012 204825011 133155414 204825011 204825012 204825013 276494610 276494609 348164206 419833803 491503400 491503401 491503400 419833803 348164206 348164205 348164206 276494609 276494608 276494609 204825012 204825011 276494608 276494607

*/
