There is a matrix *A* of size *x* × *y* filled with integers. For every <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/e87325918316c52884e4063f23cf77cfe475ee7c.png" style="max-width: 100.0%;max-height: 100.0%;"/>, <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/b2547b0e9acdacd0f9e1ca13295a4cc301cde743.png" style="max-width: 100.0%;max-height: 100.0%;"/> *A*<sub class="lower-index">*i*, *j*</sub> = *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 *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> denoting that you started in the cell containing the number *a*<sub class="lower-index">1</sub>, then moved to the cell with the number *a*<sub class="lower-index">2</sub>, 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* &lt; *x*; 1.  (*i*, *j* + 1) — only if *j* &lt; *y*; 1.  (*i* - 1, *j*) — only if *i* &gt; 1; 1.  (*i*, *j* - 1) — only if *j* &gt; 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 *a*<sub class="lower-index">1</sub>, then move to the cell containing *a*<sub class="lower-index">2</sub> (in one step), then move to the cell containing *a*<sub class="lower-index">3</sub> (also in one step) and so on. Can you choose *x* and *y* so that they don't contradict with your sequence of moves?
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 *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>) — the integers in the cells on your path.
The matrix and the path on it in the first test looks like this:

Also there exist multiple correct answers for both the first and the third examples.
8
1 2 3 6 9 8 5 2
YES
1000000000 3
6
1 2 1 2 5 3
NO
2
1 10
YES
1000000000 9
3
1 2 2
NO
1
1
YES
1000000000 1
1
6
YES
1000000000 1
2
2 3
YES
1000000000 1
2
1000000000 1
YES
1000000000 999999999
4
3 2 4 2
NO
5
1 2 5 4 3
NO
2
1 1
NO
3
1 3 4
YES
1000000000 2
1
1000000000
YES
1000000000 1
6
1 4 5 6 3 2
YES
1000000000 3
8
1 2 3 6 9 8 7 6
NO
9
4 3 2 1 5 6 7 8 9
NO
8
2 5 8 9 6 3 2 1
YES
1000000000 3
4
1 2 1 3
YES
1000000000 2
3
1 4 3
NO
5
1 2 3 4 1
NO
6
3 5 2 1 2 1
NO
2
1000000000 999999999
YES
1000000000 1
3
2 4 3
YES
1000000000 2
5
1 2 3 2 4
NO
6
10 8 6 4 2 1
YES
1000000000 2
7
1 4 7 8 9 10 11
NO
8
1 2 3 2 3 4 3 8
YES
1000000000 5
4
3 4 3 5
YES
1000000000 2
4
1 4 3 2
NO
13
1 3 4 6 5 3 1 2 4 6 5 3 1
YES
1000000000 2
3
1 3 2
NO
6
4 3 6 9 8 7
NO
6
1 2 4 3 5 6
YES
1000000000 2
5
1 2 4 3 1
YES
1000000000 2
5
1 2 4 3 5
YES
1000000000 2
5
3 6 5 4 3
NO
37
94 7 32 29 57 22 11 70 57 61 12 75 93 24 4 47 98 43 99 22 50 32 37 64 80 9 40 87 38 70 17 41 77 76 20 66 48
NO
2
99999999 100000000
YES
1000000000 1
5
3 4 5 6 2
NO
6
3 8 7 6 5 4
NO
10
999999999 999999998 999999997 999999996 999999995 999999994 999999993 999999992 999999991 999999990
YES
1000000000 1
2
1000000000 999999998
YES
1000000000 2
5
8 9 10 14 13
NO
4
1 3 2 4
NO
4
2 3 5 6
NO
5
1 2 3 4 2
NO
3
5 6 4
YES
1000000000 2
1
1000000
YES
1000000000 1
3
9 10 1
NO
28
1 3 5 7 9 10 8 6 4 2 1 2 4 3 5 6 8 7 9 10 8 7 5 6 4 3 1 2
YES
1000000000 2
5
3 4 5 6 9
NO
3
6 8 7
YES
1000000000 2
1
100000000
YES
1000000000 1
6
2 4 6 5 6 5
YES
1000000000 2
2
999999999 1000000000
YES
1000000000 1
4
3 6 7 8
NO
23
92 34 58 40 76 3 38 66 76 23 85 36 47 43 22 46 98 72 97 80 57 77 96
NO
3
6 7 4
NO
4
1 2 4 3
YES
1000000000 2
3
3 2 4
NO
5
1 4 3 2 1
NO
5
1 3 5 4 3
NO
3
19260816 19260817 19260818
YES
1000000000 1
3
1 3 6
NO
2
999999998 1000000000
YES
1000000000 2
8
2 4 6 5 6 5 3 4
YES
1000000000 2
3
4 3 6
NO
2
246642 246641
YES
1000000000 1
3
9 7 5
YES
1000000000 2
10
1 2 1 2 1 2 1 2 1 2
YES
1000000000 1
5
1 3 5 7 8
YES
1000000000 2
4
1 10 9 10
NO
2
2 4
YES
1000000000 2
8
1 2 4 3 5 6 8 7
YES
1000000000 2
3
4 3 2
YES
1000000000 1
3
3 2 1
YES
1000000000 1
4
999 1000 2000 2001
NO
3
4 2 5
NO
2
500000000 1000000000
YES
1000000000 500000000
3
4 5 7
NO
5
1 3 4 5 4
NO
7
550 555 554 553 554 555 560
YES
1000000000 5
import os
import sys
from collections import *
from itertools import *
from math import *
from array import *
from functools import lru_cache
import heapq
import bisect
import random

if sys.hexversion == 50924784:
    sys.stdin = open('cfinput.txt')
else:
    input = sys.stdin.readline
MOD = 10 ** 9 + 7


def RI():
    return map(int, input().split())


def RS():
    return input().strip().split()


"""
https://codeforces.com/problemset/problem/954/C

有一个 x 行 y 列的矩阵，你不知道 x 和 y 的大小，你只知道矩阵中的数字是从 1 开始连续递增的，即：
第一行是 1,2,3,...,y
第二行是 y+1,y+2,y+3,...,2y
……

定义矩阵上的一条路径为：从某一点出发，每一步往四个相邻格子走（不能出界），所走过的数字组成的序列。注意不能停在原地。

现在输入 n(≤2e5) 和一个长为 n 的路径 a (1≤a[i]≤1e9)。
如果存在某个矩阵能走出路径 a，且 x 和 y 均不超过 1e9，则输出 YES 和 x y，否则输出 NO。
如果有多个答案，输出任意一种。
"""


def RILST():
    return list(RI())


LIMIT = 10 ** 9


def print_x_y(x, y):
    if 1 <= x <= LIMIT and 1 <= y <= LIMIT:
        print(f'YES\n{x} {y}')
    else:
        print('NO')


def solve(n, a):
    mx = max(a)
    if n == 1:
        x = y = ceil(sqrt(mx))
        return print_x_y(x, y)

    # diff = sorted(list(set([abs(u - v) for u, v in pairwise(a)])))
    diff = sorted(list(set([abs(a[i] - a[i + 1]) for i in range(n - 1)])))
    if len(diff) > 2 or diff[0] == 0:
        return print('NO')

    if len(diff) == 1:
        y = diff[0]
        x = ceil(mx / y)
        return print_x_y(x, y)
    if len(diff) == 2:
        if diff[0] != 1:
            return print_x_y('NO')
        y = diff[1]
        x = ceil(mx / y)
        return print_x_y(x, y)



if __name__ == '__main__':
    n, = RI()
    a = RILST()
    solve(n, a)
