#include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
const int MAX = 2e5 + 5;
int l, r, col = 0, n, a[MAX];
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> n;
    for(int i = 1 ; i <= n; ++i)    cin >> a[i];
    if(n == 1) {
        cout << "YES\n" << a[1] << " " << a[1] << endl;
        return 0;
    }
    for(int i = 2; i <= n; ++i) {
        if(a[i] == a[i - 1]) {
            cout << "NO\n";
            return 0;
        }
        if(abs(a[i] - a[i - 1]) != 1) {
            if(!col)    col = abs(a[i] - a[i - 1]);
            else {
                if(col != abs(a[i] - a[i - 1])) {
                    cout << "NO\n";
                    return 0;
                }
            }
        }
    }

    if(!col) {
        cout << "YES\n" << 1000000000 << " " << 1000000000 << endl;
        return 0;
    }

    l = r = a[1];
    for(int i = 2; i <= n; ++i) {
        if(abs(a[i] - a[i - 1]) == 1) {
            bool flag = 0;

            if(a[i] % col == 0) {
                if(a[i - 1] % col != col - 1)
                    flag = 1;
            } else if(a[i] % col == 1) {
                if(a[i - 1] % col != 2 % col)
                    flag = 1;
            }
            if(flag)    {
                cout << "NO\n";
                return 0;
            }
            l = min(l, a[i]);
            r = max(r, a[i]);
        } else {
            if(r - l + 1 > col) {
                cout << "NO\n";
                return 0;
            } else if(r - l + 1 == col) {
                if(r % col != 0) {
                    cout << "NO\n";
                    return 0;
                }
            }
            l = r = a[i];
        }
    }

    if(r - l + 1 > col) {
        cout << "NO\n";
        return 0;
    } else if(r - l + 1 == col) {
        if(r % col != 0) {
            cout << "NO\n";
            return 0;
        }
    }

    cout << "YES\n" << 1000000000 << " " << col << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{

    int n;
    cin >> n;
    vector<int> v(n);
    int mx=0;
    for (int i = 0; i < n; i++)
    {
        cin >> v[i];
        mx=max(mx,v[i]);
    }
    int len = -2;
    for (int i = 1; i < n; i++)
    {
        if (abs(v[i] - v[i - 1]) > 1)
        {
            if (len == -2)
                len = abs(v[i]- v[i - 1]);
            if (len != abs(v[i] - v[i - 1]))
            {
                len = -1;
                break;
            }
        }
        if(v[i]==v[i-1]){
            len=-1;
            break;
        }
    }
    if (len != -1)
    {
        if (len == -2)
        {
            cout << "YES"<<endl << 1 << " " << mx << endl;
            return 0;
        }
        else
        {

            for (int i = 0; i < n && len != -1; i++)
            {
                bool nolast = 0, nobef = 0;
                if (v[i] % len == 0)
                {
                    nolast = 1;
                }
                if (v[i] % len == 1)
                {
                    nobef = 1;
                }
                if (nolast && i < n - 1 && v[i + 1] == v[i] + 1)
                {
                    len = -1;
                }
                if (nolast && i && v[i - 1] == v[i] + 1)
                {
                    len = -1;
                }
                if (nobef && i && v[i - 1] + 1 == v[i])
                {
                    len = -1;
                }
                if (nobef && i<n-1 && v[i + 1] + 1 == v[i])
                {
                    len = -1;
                }
            }
        }
    }
    if(len!=-1){
        int c=(mx+len-1)/len;
        cout<<"YES"<<endl;
        cout<<c<<" "<<len<<endl;
        return 0;
    }
    cout<<"NO"<<endl;
}


#include <bits\stdc++.h>
using namespace std;
#define pb push_back
int a[200005];
int main()
{

    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)scanf("%d",&a[i]);
    int x=1,y=1000000000;
    int last,tmp,t;
    int i=1;
  for(i=2;i<=n;i++)
  {
      last=a[i-1];
      t=a[i];
    if(t!=last)
    {
        tmp=abs(t-last);
        if(tmp!=1)
          {
             if(x==1||x==tmp)x=tmp;
              else
              {
                  printf("NO\n");
                  return 0;
              }
          }
    }
    else
    {
        printf("NO\n");
                  return 0;
    }
  }
  if(x!=1)
  for(int i=2;i<=n;i++)
  {
  if(a[i]==a[i-1])continue;
  if(abs(a[i]-a[i-1])==1)
  {
      if(x==2)
      {
          if(a[i]/2!=a[i-1]%2)
          {
               printf("NO\n");
           return 0;
          }
          continue;
      }
      if((a[i]%x==0||a[i-1]%x==0)&&(a[i]+a[i-1])%x==1)
      {
           printf("NO\n");
           return 0;
      }
  }
  }
  printf("YES\n");
  printf("%d %d",y,x);
return 0;
}


#include<stdio.h>
#include<string.h>
#include<iostream>
#include<math.h>
#include<cmath>
using namespace std;

int main()
{
	int i,j,n,x,y,f1,f2,mx,tmp,one,a[200010];
	while(~scanf("%d",&n))
	{
		mx=0;
		for(i=0;i<n;i++)
		{
			scanf("%d",&a[i]);
			if(a[i]>mx) mx=a[i];
		}
		one=0;
		f1=f2=1;
		y=-1;
		for(i=1;i<n;i++)
		{
			if(a[i]==a[i-1])
			{
				f1=0;
				break;
			}
			if(abs(a[i]-a[i-1])!=1)
			{
				one=1;
				tmp=abs(a[i]-a[i-1]);
				if(y==-1) y=tmp;
				else if(y!=tmp)
				{
					f2=0;
					break;
				}
			}
		}
		if(!one)
		{
			y=1;
			x=ceil((double)mx/y);
		}
		int f=1;
		if(f1&&f2&&one)
		{
			for(i=1;i<n;i++)
			{
				if(a[i]%y==0&&a[i-1]==a[i]+1)
				{
					f=0;
					break;
				}
				if(a[i-1]%y==0&&a[i]==a[i-1]+1)
				{
					f=0;
					break;
				}
			}
		}
		if(!f1||!f2||!f) printf("NO\n");
		else
		{
			x=ceil((double)mx/y);
			printf("YES\n");
			printf("%d %d\n",x,y);
		}
	}
	return 0;
}


#include <bits\stdc++.h>
using namespace std;
#define pb push_back
int a[200005];
int main()
{

    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)scanf("%d",&a[i]);
    int x=1,y=1000000000;
    int last,tmp,t;
    int i=1;
  for(i=2;i<=n;i++)
  {
      last=a[i-1];
      t=a[i];
    if(t!=last)
    {
        tmp=abs(t-last);
        if(tmp!=1)
          {
             if(x==1||x==tmp)x=tmp;
              else
              {
                  printf("NO\n");
                  return 0;
              }
          }
    }
    else
    {
        printf("NO\n");
                  return 0;
    }
  }
  if(x!=1)
  for(int i=2;i<=n;i++)
  {
  if(a[i]==a[i-1])continue;
  if(abs(a[i]-a[i-1])==1)
  {
      if((a[i]%x==0||a[i-1]%x==0)&&(a[i]+a[i-1])%x==1&&a[i]!=1&&a[i-1]!=1)
      {
           printf("NO\n");
           return 0;
      }
  }
  }
  printf("YES\n");
  printf("%d %d",y,x);
return 0;
}


#include <bits\stdc++.h>
using namespace std;
#define pb push_back
int a[200005];
int main()
{

    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)scanf("%d",&a[i]);
    int x=1,y=1000000000;
    int last,tmp,t;
    int i=1;
  for(i=2;i<=n;i++)
  {
      last=a[i-1];
      t=a[i];
    if(t!=last)
    {
        tmp=abs(t-last);
        if(tmp!=1)
          {
             if(x==1||x==tmp)x=tmp;
              else
              {
                  printf("NO\n");
                  return 0;
              }
          }
    }
    else
    {
        printf("NO\n");
                  return 0;
    }
  }
  if(x!=1)
  for(int i=2;i<=n;i++)
  {
  if(a[i]==a[i-1])continue;
  if(abs(a[i]-a[i-1])==1)
  {
      if(x==2)
      {
          if(a[i]/2!=a[i-1]/2)
          {
               printf("NO\n");
           return 0;
          }
          continue;
      }
      if((a[i]%x==0||a[i-1]%x==0)&&(a[i]+a[i-1])%x==1)
      {
           printf("NO\n");
           return 0;
      }
  }
  }
  printf("YES\n");
  printf("%d %d",y,x);
return 0;
}


#include <bits\stdc++.h>
using namespace std;
#define pb push_back
int a[200005];
int main()
{

    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)scanf("%d",&a[i]);
    int x=1,y=1000000000;
    int last,tmp,t;
    int i=1;
  for(i=2;i<=n;i++)
  {
      last=a[i-1];
      t=a[i];
    if(t!=last)
    {
        tmp=abs(t-last);
        if(tmp!=1)
          {
             if(x==1||x==tmp)x=tmp;
              else
              {
                  printf("NO\n");
                  return 0;
              }
          }
    }
    else
    {
        printf("NO\n");
                  return 0;
    }
  }
  if(x!=1)
  for(int i=2;i<=n;i++)
  {
  if(a[i]==a[i-1])continue;
  if(abs(a[i]-a[i-1])==1)
  {
      if((a[i]%x==0||a[i-1]%x==0)&&(a[i]+a[i-1])%x==1)
      {
           printf("NO\n");
           return 0;
      }
  }
  }
  printf("YES\n");
  printf("%d %d",y,x);
return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#define ll long long
#define ss second
#define ff first
using namespace std;
ll n,x=1e9,ans=-1,a[200101];
int main(){
    cin>>n;
    for(int i=0;i<n;i++)cin>>a[i];
    for(int i=0;i<n-1;i++){
        if(a[i]==a[i+1])return cout<<"NO",0;
        if(abs(a[i]-a[i+1])>1){
            if(ans==-1)ans=abs(a[i+1]-a[i]);
            else if(ans!=abs(a[i+1]-a[i])){
                    return cout<<"NO",0;
            }
        }
    }
    if(ans==-1)return cout<<"YES"<<endl<<x<<' '<<1,0;
    for(int i=0;i<n-1;i++){
        if(abs(a[i]-a[i+1])==1){
            if((a[i]-1)/ans!=(a[i+1]-1)/ans)return cout<<"NO",0;
        }
    }
    cout<<"YES"<<endl;
    cout<<x<<' '<<ans;
}


#include <bits/stdc++.h>

using namespace std;

#define rfile freopen("path.in", "r", stdin)
#define wfile freopen("path.out", "w", stdout)
#define files rfile; wfile
#define pb push_back
#define f first
#define s second
#define sws ios_base::sync_with_stdio(0)

typedef long long ll;
typedef long double ld;
typedef vector< int > vi;
typedef vector< char > vc;
typedef vector< vc > vvc;
typedef vector< vi > vvi;
typedef map< int, int > mapT;
typedef pair< int, int > pairT;

const int inf = (int)1e9;
const ll llinf = (ll)9e18;
const int N = (int)1e6 + 111;
const ld PI = (ld)acos(-1);

int main()
{
	int n, mx = 0, y = -1;
	scanf("%d", &n);
	vi a(n);
	for (int i = 0; i < n; i++)
	{
		scanf("%d", &a[i]);
		mx = max(mx, a[i]);
	}
	for (int i = 1; i < n; i++)
	{
		if (a[i] == a[i - 1])
		{
			printf("NO");
			return 0;
		}
		if (abs(a[i] - a[i - 1]) == 1)
			continue;
		if (y == -1)
			y = abs(a[i] - a[i - 1]);
		else
			if (y == abs(a[i] - a[i - 1]))
				continue;
			else
			{
				printf("NO");
				return 0;
			}
	}
	if (y == -1)
		printf("YES\n%d %d", 1, mx);
	else
	{
		for (int i = 0; i < n - 1; i++)
			if (a[i + 1] - a[i] == 1)
			{
				if ((a[i] % y == 0 ? y : a[i] % y) == y)
				{
					printf("NO");
					return 0;
				}
			}
			else
				if (a[i] - a[i + 1] == 1)
					if ((a[i] % y == 0 ? y : a[i] % y) == 1)
					{
						printf("NO");
						return 0;
					}
		printf("YES\n%d %d", mx / y + 2, y);
	}
	return 0;
}


#include <bits/stdc++.h>

#define ll long long
#define pb push_back
#define vi vector<int>
#define sz(a) (int((a).size()))
#define mp make_pair
#define f first
#define s second

using namespace std;
const int N = 200200;

int n;
int a[N];
int x = (int)1e9, y = -1;

bool check(int xa, int ya, int xb, int yb) {
	if (xa == xb)
		return abs(ya - yb) == 1;
	else if (ya == yb)
		return abs(xa - xb) == 1;
	return false;
}

int main() {
	ios_base::sync_with_stdio(0), cin.tie(0);
	cin >> n;
	for (int i = 1; i <= n; i++) cin >> a[i];

	for (int i = 2; i <= n; i++) {
		if (abs(a[i] - a[i - 1]) != 1) {
			y = abs(a[i] - a[i - 1]);
			if (y == 0) {
				cout << "NO\n";
				return 0;
			}
			break;
		}
	}

	if (y == -1) {
		cout << "YES\n";
		cout << x << " " << 1 << endl;
		return 0;
	}

	for (int i = 2; i <= n; i++) {
		int x1 = (a[i - 1] + y - 1) / y, x2 = (a[i] + y - 1) / y;
		int y1 = a[i - 1] % y, y2 = a[i] % y;
		if (y1 == 0) y1 = y;
		if (y2 == 0) y2 = y;

		if (!check(x1, y1, x2, y2)) {
			cout << "NO\n";
			return 0;
		}
	}

	cout << "YES\n";
	cout << x << " " << y << endl;

	return 0;
}


 #include<bits/stdc++.h>
using namespace std;
#define maxn 200020
#define inf 1000000000
int f[maxn],n;
int X,Y;
inline int Abs(int a){
    int i=a>>31;
    return !i?a:(~a+1);
}
int main(){
	int maxx=0;
	scanf("%d",&n);
	for(register int i=1;i<=n;++i)scanf("%d",&f[i]),maxx=max(maxx,f[i]);
	for(register int i=1;i<=n;++i)if(f[i]>inf){
		printf("NO\n");
		return 0;
	}
	for(register int i=2;i<=n;++i){
		int u=Abs(f[i]-f[i-1]);
		if(!u){
			printf("NO\n");
			return 0;
		}
		if(u!=1){
			if(!Y)Y=u;
			else if(Y!=u){
				printf("NO\n");
				return 0;
			}
		}
	}if(!Y)Y=maxx;
	for(register int i=1;i<n;++i){
		if(f[i]%Y==0&&f[i+1]==f[i]+1){
			printf("NO\n");
			return 0;
		}
		if(f[i]%Y==1&&f[i+1]==f[i]-1){
			printf("NO\n");
			return 0;
		}X=max(X,(f[i]-1)/Y+1);
	}X=max(X,(f[n]-1)/Y+1);
	printf("YES\n%d %d\n",X,Y);
	return 0;
}


/**
	Template by Akikaze (秋風) - formerly proptit_4t41.
	Code written by a random fan of momocashew and Chiho.

	H△G x Mili - November 27th, 2013
	Mag Mell (Mili) - Sep 17th, 2014
	H△G x Mili Vol.2 - May 9th, 2015
	Miracle Milk (Mili) - Oct 12th, 2016
	青色フィルム (H△G) - February 14th, 2018
	Millennium Mother (Mili) - April 25th, 2018
**/

/** -----PRAGMA----- **/
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>
using namespace std;

/** -----BASIC MACROES----- **/
#define endl '\n'
#define i64 long long
#define ld long double
#define pub push_back
#define mp make_pair
#define fi first
#define se second
const long long MOD = 1000000007LL, INF = 1e9, LINF = 1e18;
const long double PI = 3.141592653589793116, EPS = 1e-9, GOLD = ((1+sqrt(5))/2);
typedef vector<i64> vi;
typedef vector<ld> vd;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef pair<i64, i64> pii;
typedef pair<i64, pii> pip;
typedef pair<pii, i64> ppi;

/** -----BIT CONTROLS----- **/
template<class T> int getbit(T s, int i) { return (s >> 1) & 1; }
template<class T> T onbit(T s, int i) { return s | (T(1) << i); }
template<class T> T offbit(T s, int i) { return s & (~(T(1) << i)); }
template<class T> int cntbit(T s) { return __builtin_popcount(s); }

/** -----IDEAS/ALGORITHMS-----

    -------------------------- **/

/** -----CUSTOM TYPEDEFS/DEFINES----- **/

/** -----GLOBAL VARIABLES----- **/
i64 n; vi a;

/** -----EXTENSIVE FUNCTIONS----- **/

/** -----COMPULSORY FUNCTIONS----- **/
void VarInput() {
	ios_base::sync_with_stdio(0); cin.tie(NULL);
	cin >> n; a.resize(n);
	for (i64 i=0; i<n; i++) cin >> a[i];
}

void ProSolve() {
	i64 x = 0, y = 0;
	if (n == 1) {
		cout << "YES\n1000000000 1000000000"; return;
	}
	for (i64 i=1; i<n; i++) {
		if (abs(a[i] - a[i-1]) != 1) {
			if (abs(a[i] - a[i-1]) == 0) {cout << "NO"; return;}
			if (y == 0) y = abs(a[i] - a[i-1]);
			else if (y != abs(a[i] - a[i-1])) {cout << "NO"; return;}
		}
	}
	if (y == 0) {cout << "YES\n1000000000 1000000000"; return;}
	i64 currRow = a[0] / y; if (a[0] % y != 0) currRow++;
	for (i64 i=1; i<n; i++) {
		if (abs(a[i] - a[i-1]) == 1) {
			if (max(a[i], a[i-1]) - (currRow-1) * y > y || min(a[i], a[i-1]) - (currRow-1) * y < 1) {
				cout << "NO"; return;
			}
		}
		else if (a[i] > a[i-1]) currRow++;
		else currRow--;
	}
	cout << "YES\n1000000000" << " " << y << endl;
}

/** -----MAIN FUNCTION----- **/
int main() {
			#ifdef Akikaze
			//freopen("FILE.INP", "r", stdin);
			//freopen("FILE.OUT", "w", stdout);
			#endif
	VarInput();
			#ifdef Akikaze
			auto TIME1 = chrono::steady_clock::now();
			#endif
	ProSolve();
			#ifdef Akikaze
			auto TIME2 = chrono::steady_clock::now();
			auto DIFF = TIME2 - TIME1;
			cout << "\n\nTime elapsed: " << fixed << setprecision(18) << chrono::duration<double>(DIFF).count() << " seconds.";
			#endif
	return 0;
}


#include<cstdio>
#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
const int N = 200010;
int h,l,n,a[N];
int main()
{	//freopen("txt.in","r",stdin);
	//freopen("txt.out","w",stdout);
	scanf("%d",&n);
	h = l = 1e9; int flag = 0;
	for(int i = 1;i <= n;i++){
		scanf("%d",&a[i]);
		if(i==1||abs(a[i]-a[i-1])==1) continue;
		if(h!=1e9&&h!=abs(a[i] - a[i-1])||a[i]==a[i-1]) {flag = 1;break;}
		h = abs(a[i] - a[i-1]);
	}
	if(!flag)
	for(int i = 2;i <= n;i++){
		if(abs(a[i]-a[i-1])==1 && (a[i]-1)/h+1!=(a[i-1]-1)/h+1) {flag = 1;break;}
	}
	if(flag) {puts("NO");}
	else printf("YES\n%d %d\n",l,h);
	return 0;
}//by tkys_Austin;


#include <bits\stdc++.h>
using namespace std;
#define pb push_back
int a[200005];
int main()
{

    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)scanf("%d",&a[i]);
    int x=1,y=1000000000;
    int last,tmp,t;
    int i=1;
  for(i=2;i<=n;i++)
  {
      last=a[i-1];
      t=a[i];
    if(t!=last)
    {
        tmp=abs(t-last);
        if(tmp!=1)
          {
             if(x==1||x==tmp)x=tmp;
              else
              {
                  printf("NO\n");
                  return 0;
              }
          }
    }
    else
    {
        printf("NO\n");
                  return 0;
    }
  }
  if(x!=1)
  for(int i=2;i<=n;i++)
  {
  if(a[i]==a[i-1])continue;
  if(abs(a[i]-a[i-1])==1)
  {
      if(x==2)
      {
          if((a[i]+1)/2!=(a[i-1]+1)/2)
          {
               printf("NO\n");
           return 0;
          }
          continue;
      }
      if((a[i]%x==0||a[i-1]%x==0)&&(a[i]+a[i-1])%x==1)
      {
           printf("NO\n");
           return 0;
      }
  }
  }
  printf("YES\n");
  printf("%d %d",y,x);
return 0;
}


#include <bits\stdc++.h>
using namespace std;
#define pb push_back
int a[200005];
int main()
{

    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)scanf("%d",&a[i]);
    int x=1,y=1000000000;
    int last,tmp,t;
    int i=1;
  for(i=2;i<=n;i++)
  {
      last=a[i-1];
      t=a[i];
      if(t>last)
      {
          tmp=t-last;
          if(tmp!=1)
          {
             if(x==1||x==tmp)x=tmp;
              else
              {
                  printf("NO\n");
                  return 0;
              }
          }
      }
      else
        if(t<last)
      {
        tmp=last-t;
        if(tmp!=1)
          {
             if(x==1||x==tmp)x=tmp;
              else
              {
                  printf("NO\n");
                  return 0;
              }
          }
      }
  }
  if(x!=1)
  for(int i=2;i<=n;i++)
  {
  if(a[i]==a[i-1])continue;
  if(abs(a[i]-a[i-1])==1)
  {
      if((a[i]%x==0||a[i-1]%x==0)&&(a[i]+a[i-1])%x==1)
      {
           printf("NO\n");
           return 0;
      }
  }
  }
  printf("YES\n");
  printf("%d %d",y,x);
return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int INF = 1000000000;
int a[size_t(1e6)];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n, m = INF;
    cin >> n;
    for (ll i = 0; i < n; ++i) {
        cin >> a[i];
        a[i]--;
        if (i != 0 && abs(a[i - 1] - a[i]) > 1) m = abs(a[i] - a[i - 1]);
    }
    int x = a[0] / m;
    int y = a[0] % m;
    for (int i = 1; i < n; ++i) {
        int newx = a[i] / m;
        int newy = a[i] % m;
        if ((x == newx && y == newy) || abs(x - newx) > 1 ||
            abs(newy - y) > 1 || (abs(newx - x) == 1 && abs(newy - y) == 1)) {
            cout << "NO\n";
            return 0;
        }
        x = newx;
        y = newy;
    }
    cout << "YES\n" << INF << " " << m << "\n";
    return 0;
}


#pragma option -O2
#include <bits/stdc++.h>

using namespace std;

const int INF = 1000000000;
int a[size_t(1e6)];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n, m = INF;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        a[i]--;
        if (i != 0 && abs(a[i - 1] - a[i]) > 1) m = abs(a[i] - a[i - 1]);
    }
    int x = a[0] / m;
    int y = a[0] % m;
    for (int i = 1; i < n; ++i) {
        int newx = a[i] / m;
        int newy = a[i] % m;
        if ((x == newx && y == newy) || abs(x - newx) > 1 ||
            abs(newy - y) > 1 || (abs(newx - x) == 1 && abs(newy - y) == 1)) {
            cout << "NO\n";
            return 0;
        }
        x = newx;
        y = newy;
    }
    cout << "YES\n" << INF << " " << m << "\n";
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll INF = 1000000000;

int main() {
    ll n, m = INF;
    cin >> n;
    bool flag = false;
    vector<ll> vec(n);
    ll mx = 0;
    for (ll i = 0; i < n; ++i) {
        cin >> vec[i];
        mx = max(vec[i]--, mx);
        if (!flag && i != 0 && abs(vec[i - 1] - vec[i]) > 1) {
            m = abs(vec[i] - vec[i - 1]);
            flag = true;
        }
        /*if (flag && i != 0 && abs(vec[i - 1] - vec[i]) > 1 && m != abs(vec[i] - vec[i - 1]) && vec[i] % m != 0 && vec[i - 1] % m != 0) {
            cout << "NO\n";
            return 0;
        }*/
    }
    int x = vec[0] / m;
    int y = vec[0] % m;
    for (int i = 1; i < n; ++i) {
        int newx = vec[i] / m;
        int newy = vec[0] % m;
        if (abs(x - newx) > 1 || abs(newy - y) > 1 || (abs(newx - x) == 1 && abs(newy - y) == 1)) {
            cout << "NO\n";
            return 0;
        }
    }
    cout << "YES\n" << INF << " " << m << "\n";
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll INF = 1000000000;

int main() {
    ll n, m = INF;
    cin >> n;
    bool flag = false;
    vector<ll> vec(n);
    ll mx = 0;
    for (ll i = 0; i < n; ++i) {
        cin >> vec[i];
        mx = max(vec[i]--, mx);
        if (!flag && i != 0 && abs(vec[i - 1] - vec[i]) > 1) {
            m = abs(vec[i] - vec[i - 1]);
            flag = true;
        }
        if (flag && i != 0 && abs(vec[i - 1] - vec[i]) > 1 && m != abs(vec[i] - vec[i - 1])) {
            cout << "NO\n";
            return 0;
        }
    }
    for (int i = 1; i < n; ++i) {
        if (vec[i] % m == 0 && abs(vec[i - 1] - vec[i]) != m && !(vec[i - 1] - 1 == vec[i])) {
            cout << "NO\n";
            return 0;
        }
        if (vec[i - 1] % m == 0 && abs(vec[i] - vec[i - 1]) != m && !(vec[i] - 1 == vec[i - 1])) {
            cout << "NO\n";
            return 0;
        }
    }
    cout << "YES\n" << INF << " " << m << "\n";
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int INF = 1000000000;
int a[size_t(1e6)];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n, m = INF;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        a[i]--;
        if (i != 0 && abs(a[i - 1] - a[i]) > 1) m = abs(a[i] - a[i - 1]);
    }
    int x = a[0] / m;
    int y = a[0] % m;
    for (int i = 1; i < n; ++i) {
        int newx = a[i] / m;
        int newy = a[i] % m;
        if ((x == newx && y == newy) || abs(x - newx) > 1 ||
            abs(newy - y) > 1 || (abs(newx - x) == 1 && abs(newy - y) == 1)) {
            cout << "NO\n";
            return 0;
        }
        x = newx;
        y = newy;
    }
    cout << "YES\n" << INF << " " << m << "\n";
    return 0;
}


#pragma option -O3
#include <bits/stdc++.h>

using namespace std;

const int INF = 1000000000;
int a[size_t(1e6)];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n, m = INF;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        a[i]--;
        if (i != 0 && abs(a[i - 1] - a[i]) > 1) m = abs(a[i] - a[i - 1]);
    }
    int x = a[0] / m;
    int y = a[0] % m;
    for (int i = 1; i < n; ++i) {
        int newx = a[i] / m;
        int newy = a[i] % m;
        if ((x == newx && y == newy) || abs(x - newx) > 1 ||
            abs(newy - y) > 1 || (abs(newx - x) == 1 && abs(newy - y) == 1)) {
            cout << "NO\n";
            return 0;
        }
        x = newx;
        y = newy;
    }
    cout << "YES\n" << INF << " " << m << "\n";
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll INF = 1000000000;

int main() {
    ll n, m = INF;
    cin >> n;
    bool flag = false;
    vector<ll> vec(n);
    ll mx = 0;
    for (ll i = 0; i < n; ++i) {
        cin >> vec[i];
        mx = max(vec[i]--, mx);
        if (!flag && i != 0 && abs(vec[i - 1] - vec[i]) > 1) {
            m = abs(vec[i] - vec[i - 1]);
            flag = true;
        }
        if (flag && i != 0 && abs(vec[i - 1] - vec[i]) > 1 && m != abs(vec[i] - vec[i - 1])) {
            cout << "NO\n";
            return 0;
        }
    }
    cout << "YES\n" << INF << " " << m << "\n";
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll INF = 1000000000;

int main() {
    ll n, m = INF;
    cin >> n;
    bool flag = false;
    vector<ll> vec(n);
    ll mx = 0;
    for (ll i = 0; i < n; ++i) {
        cin >> vec[i];
        mx = max(vec[i]--, mx);
        if (!flag && i != 0 && abs(vec[i - 1] - vec[i]) > 1) {
            m = abs(vec[i] - vec[i - 1]);
            flag = true;
        }
        /*if (flag && i != 0 && abs(vec[i - 1] - vec[i]) > 1 && m != abs(vec[i] - vec[i - 1]) && vec[i] % m != 0 && vec[i - 1] % m != 0) {
            cout << "NO\n";
            return 0;
        }*/
    }
    int x = vec[0] / m;
    int y = vec[0] % m;
    for (int i = 1; i < n; ++i) {
        int newx = vec[i] / m;
        int newy = vec[i] % m;
        if (abs(x - newx) > 1 || abs(newy - y) > 1 || (abs(newx - x) == 1 && abs(newy - y) == 1)) {
            cout << "NO\n";
            return 0;
        }
        if (x == newx && y == newy) {
            cout << "NO\n";
            return 0;
        }
        x = newx;
        y = newy;
    }
    cout << "YES\n" << INF << " " << m << "\n";
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll INF = 1000000000;

int main() {
    ll n, m = INF;
    cin >> n;
    bool flag = false;
    vector<ll> vec(n);
    ll mx = 0;
    for (ll i = 0; i < n; ++i) {
        cin >> vec[i];
        mx = max(vec[i]--, mx);
        if (!flag && i != 0 && abs(vec[i - 1] - vec[i]) > 1) {
            m = abs(vec[i] - vec[i - 1]);
            flag = true;
        }
        /*if (flag && i != 0 && abs(vec[i - 1] - vec[i]) > 1 && m != abs(vec[i] - vec[i - 1]) && vec[i] % m != 0 && vec[i - 1] % m != 0) {
            cout << "NO\n";
            return 0;
        }*/
    }
    int x = vec[0] / m;
    int y = vec[0] % m;
    for (int i = 1; i < n; ++i) {
        int newx = vec[i] / m;
        int newy = vec[0] % m;
        if (abs(x - newx) > 1 || abs(newy - y) > 1 || (abs(newx - x) == 1 && abs(newy - y) == 1)) {
            cout << "NO\n";
            return 0;
        }
        x = newx;
        y = newy;
    }
    cout << "YES\n" << INF << " " << m << "\n";
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll INF = 1000000000;

int main() {
    ll n, m = INF;
    cin >> n;
    bool flag = false;
    vector<ll> vec(n);
    ll mx = 0;
    for (ll i = 0; i < n; ++i) {
        cin >> vec[i];
        mx = max(vec[i]--, mx);
        if (!flag && i != 0 && abs(vec[i - 1] - vec[i]) > 1) {
            m = abs(vec[i] - vec[i - 1]);
            flag = true;
        }
        if (flag && i != 0 && abs(vec[i - 1] - vec[i]) > 1 && m != abs(vec[i] - vec[i - 1]) && vec[i] % m != 0 && vec[i - 1] % m != 0) {
            cout << "NO\n";
            return 0;
        }
    }
    for (int i = 1; i < n; ++i) {
        if (vec[i] % m == 0 && abs(vec[i - 1] - vec[i]) != m && !(vec[i - 1] - 1 == vec[i])) {
            cout << "NO\n";
            return 0;
        }
        if (vec[i - 1] % m == 0 && abs(vec[i] - vec[i - 1]) != m && !(vec[i] - 1 == vec[i - 1])) {
            cout << "NO\n";
            return 0;
        }
    }
    cout << "YES\n" << INF << " " << m << "\n";
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll INF = 1000000000;

int main() {
    ll n, m = INF;
    cin >> n;
    bool flag = false;
    vector<ll> vec(n);
    ll mx = 0;
    for (ll i = 0; i < n; ++i) {
        cin >> vec[i];
        mx = max(vec[i]--, mx);
        if (!flag && i != 0 && abs(vec[i - 1] - vec[i]) > 1) {
            m = abs(vec[i] - vec[i - 1]);
            flag = true;
        }
        /*if (flag && i != 0 && abs(vec[i - 1] - vec[i]) > 1 && m != abs(vec[i] - vec[i - 1]) && vec[i] % m != 0 && vec[i - 1] % m != 0) {
            cout << "NO\n";
            return 0;
        }*/
    }
    int x = vec[0] / m;
    int y = vec[0] % m;
    for (int i = 1; i < n; ++i) {
        int newx = vec[i] / m;
        int newy = vec[i] % m;
        if (abs(x - newx) > 1 || abs(newy - y) > 1 || (abs(newx - x) == 1 && abs(newy - y) == 1)) {
            cout << "NO\n";
            return 0;
        }
        x = newx;
        y = newy;
    }
    cout << "YES\n" << INF << " " << m << "\n";
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int INF = 1000000000;

int main() {
    int n, m = INF;
    cin >> n;
    bool flag = false;
    vector<int> vec(n);
    int mx = 0;
    for (int i = 0; i < n; ++i) {
        cin >> vec[i];
        vec[i]--;
        mx = max(vec[i] + 1, mx);
        if (!flag && i != 0 && abs(vec[i - 1] - vec[i]) > 1) {
            m = abs(vec[i] - vec[i - 1]);
            flag = true;
        }
        if (flag && i != 0 && abs(vec[i - 1] - vec[i]) > 1 && m != abs(vec[i] - vec[i - 1])) {
            cout << "NO\n";
            return 0;
        }
    }
    cout << "YES\n" << mx / m + int(bool(mx % m)) << " " << m << "\n";
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int MAX=1e6;
const int MOD=1e9+7;
const double PI=acos(-1);
typedef __int64 ll;
ll a[MAX];
int main()
{
    int n;
    cin>>n;
    for(int i=1;i<=n;i++)scanf("%I64d",&a[i]);
    ll x=-1,y=-1;
    for(int i=1;i<n;i++)
    {
        if(a[i]<a[i+1])
        {
            if(a[i+1]>a[i]+1)
            {
                if(y==-1)y=a[i+1]-a[i];
                if(a[i+1]-a[i]!=y)
                {
                    puts("NO");
                    return 0;
                }
            }
        }
        else if(a[i]==a[i+1])
        {
            puts("NO");
            return 0;
        }
        else
        {
            if(a[i]>a[i+1]+1)
            {
                if(y==-1)y=a[i]-a[i+1];
                if(a[i]-a[i+1]!=y)
                {
                    puts("NO");
                    return 0;
                }
            }
        }
    }
    sort(a+1,a+n+1);
    if(y==-1)y=a[n];
    x=a[n]/y+(a[n]%y!=0);
    if(x>=1&&y>=1&&y<=1e9&&x<=1e9)printf("YES\n%I64d %I64d\n",x,y);
    else puts("NO");
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int MAX=1e6;
const int MOD=1e9+7;
const double PI=acos(-1);
typedef __int64 ll;
ll a[MAX];
int main()
{
    int n;
    cin>>n;
    for(int i=1;i<=n;i++)scanf("%I64d",&a[i]);
    for(int i=1;i<n;i++)
    {
        if(a[i]<a[i+1])
        {
            if(a[i+1]>a[i]+1)
            {
                if(y==-1)y=a[i+1]-a[i];
                if(a[i+1]-a[i]!=y)
                {
                    puts("NO");
                    return 0;
                }
            }
        }
        else if(a[i]==a[i+1])
        {
            puts("NO");
            return 0;
        }
        else
        {
            if(a[i]>a[i+1]+1)
            {
                if(y==-1)y=a[i]-a[i+1];
                if(a[i]-a[i+1]!=y)
                {
                    puts("NO");
                    return 0;
                }
            }
        }
    }
    sort(a+1,a+n+1);
    int tot=0,maxy=0;
    for(int i=1;i<=n;i++)
    {
        if(i==1||a[i]==a[i-1]+1)tot++;
        else tot=1;
        maxy=max(maxy,tot);
    }
    if(y==-1)y=a[n];
    if(x>=1&&y>=1&&y<=1e9&&x<=1e9&&maxy<=y)printf("YES\n%1000000000 %I64d\n",y);
    else puts("NO");
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int MAX=1e6;
const int MOD=1e9+7;
const double PI=acos(-1);
typedef __int64 ll;
ll a[MAX];
int main()
{
    int n;
    cin>>n;
    for(int i=1;i<=n;i++)scanf("%I64d",&a[i]);
    ll x=-1,y=-1;
    ll maxy=-1;
    for(int i=1;i<n;i++)
    {
        if(a[i]<a[i+1])
        {
            if(a[i+1]==a[i]+1)maxy=max(maxy,a[i+1]);
            else
            {
                if(y==-1)y=a[i+1]-a[i];
                if(a[i+1]-a[i]!=y)
                {
                    puts("NO");
                    return 0;
                }
            }
        }
        else if(a[i]==a[i+1])
        {
            puts("NO");
            return 0;
        }
        else
        {
            if(a[i]==a[i+1]+1)maxy=max(maxy,a[i]);
            else
            {
                if(y==-1)y=a[i]-a[i+1];
                if(a[i]-a[i+1]!=y)
                {
                    puts("NO");
                    return 0;
                }
            }
        }
    }
    sort(a+1,a+n+1);
    x=a[n]/y+(a[n]%y!=0);
    if(x>=1&&y>=1&&y<=1e9&&x<=1e9)printf("YES\n%I64d %I64d\n",x,y);
    else puts("NO");
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int MAX=1e6;
const int MOD=1e9+7;
const double PI=acos(-1);
typedef __int64 ll;
ll a[MAX];
int main()
{
    int n;
    cin>>n;
    for(int i=1;i<=n;i++)scanf("%I64d",&a[i]);
    int y=-1;
    for(int i=1;i<n;i++)
    {
        if(a[i]<a[i+1])
        {
            if(a[i+1]>a[i]+1)
            {
                if(y==-1)y=a[i+1]-a[i];
                if(a[i+1]-a[i]!=y)
                {
                    puts("NO");
                    return 0;
                }
            }
        }
        else if(a[i]==a[i+1])
        {
            puts("NO");
            return 0;
        }
        else
        {
            if(a[i]>a[i+1]+1)
            {
                if(y==-1)y=a[i]-a[i+1];
                if(a[i]-a[i+1]!=y)
                {
                    puts("NO");
                    return 0;
                }
            }
        }
    }
    sort(a+1,a+n+1);
    int tot=0,maxy=0;
    for(int i=1;i<=n;i++)
    {
        if(i==1||a[i]==a[i-1]+1)tot++;
        else tot=1;
        maxy=max(maxy,tot);
    }
    if(y==-1)y=a[n];
    if(y>=1&&y<=1e9&&maxy<=y)printf("YES\n%1000000000 %I64d\n",y);
    else puts("NO");
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int MAX=1e6;
const int MOD=1e9+7;
const double PI=acos(-1);
typedef __int64 ll;
ll a[MAX];
int main()
{
    int n;
    cin>>n;
    for(int i=1;i<=n;i++)scanf("%I64d",&a[i]);
    ll y=-1;
    for(int i=1;i<n;i++)
    {
        if(a[i]<a[i+1])
        {
            if(a[i+1]>a[i]+1)
            {
                if(y==-1)y=a[i+1]-a[i];
                if(a[i+1]-a[i]!=y)
                {
                    puts("NO");
                    return 0;
                }
            }
        }
        else if(a[i]==a[i+1])
        {
            puts("NO");
            return 0;
        }
        else
        {
            if(a[i]>a[i+1]+1)
            {
                if(y==-1)y=a[i]-a[i+1];
                if(a[i]-a[i+1]!=y)
                {
                    puts("NO");
                    return 0;
                }
            }
        }
    }
    sort(a+1,a+n+1);
    int tot=0,maxy=0;
    for(int i=1;i<=n;i++)
    {
        if(i==1||a[i]==a[i-1]+1)tot++;
        else tot=1;
        maxy=max(maxy,tot);
    }
    if(y==-1)y=a[n];
    if(y>=1&&y<=1e9&&maxy<=y)printf("YES\n1000000000 %I64d\n",y);
    else puts("NO");
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int MAX=1e6;
const int MOD=1e9+7;
const double PI=acos(-1);
typedef __int64 ll;
ll a[MAX];
int main()
{
    int n;
    cin>>n;
    for(int i=1;i<=n;i++)scanf("%I64d",&a[i]);
    ll y=-1;
    for(int i=1;i<n;i++)
    {
        if(a[i]<a[i+1])
        {
            if(a[i+1]>a[i]+1)
            {
                if(y==-1)y=a[i+1]-a[i];
                if(a[i+1]-a[i]!=y)
                {
                    puts("NO");
                    return 0;
                }
            }
        }
        else if(a[i]==a[i+1])
        {
            puts("NO");
            return 0;
        }
        else
        {
            if(a[i]>a[i+1]+1)
            {
                if(y==-1)y=a[i]-a[i+1];
                if(a[i]-a[i+1]!=y)
                {
                    puts("NO");
                    return 0;
                }
            }
        }
    }
    int tot=0,maxy=0;
    for(int i=1;i<=n;i++)
    {
        if(i==1||a[i]==a[i-1]+1)tot++;
        else tot=1;
        maxy=max(maxy,tot);
    }
    if(y==-1)y=a[n];
    //cout<<y<<" "<<maxy;
    if(y>=1&&y<=1e9&&maxy<=y)printf("YES\n1000000000 %I64d\n",y);
    else puts("NO");
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int MAX=1e6;
const int MOD=1e9+7;
const double PI=acos(-1);
typedef __int64 ll;
ll a[MAX];
int main()
{
    int n;
    cin>>n;
    for(int i=1;i<=n;i++)scanf("%I64d",&a[i]);
    ll y=-1;
    for(int i=1;i<n;i++)
    {
        if(a[i]<a[i+1])
        {
            if(a[i+1]>a[i]+1)
            {
                if(y==-1)y=a[i+1]-a[i];
                if(a[i+1]-a[i]!=y)
                {
                    puts("NO");
                    return 0;
                }
            }
        }
        else if(a[i]==a[i+1])
        {
            puts("NO");
            return 0;
        }
        else
        {
            if(a[i]>a[i+1]+1)
            {
                if(y==-1)y=a[i]-a[i+1];
                if(a[i]-a[i+1]!=y)
                {
                    puts("NO");
                    return 0;
                }
            }
        }
    }
    sort(a+1,a+n+1);
    int tot=0,maxy=0;
    for(int i=1;i<=n;i++)
    {
        if(i==1||a[i]==a[i-1]+1)tot++;
        else tot=1;
        maxy=max(maxy,tot);
    }
    if(y==-1)y=a[n];
    if(y>=1&&y<=1e9&&maxy<y)printf("YES\n1000000000 %I64d\n",y);
    else puts("NO");
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int MAX=1e6;
const int MOD=1e9+7;
const double PI=acos(-1);
typedef __int64 ll;
ll a[MAX];
int main()
{
    int n;
    cin>>n;
    for(int i=1;i<=n;i++)scanf("%I64d",&a[i]);
    ll x=-1,y=-1;
    for(int i=1;i<n;i++)
    {
        if(a[i]<a[i+1])
        {
            if(a[i+1]>a[i]+1)
            {
                if(y==-1)y=a[i+1]-a[i];
                if(a[i+1]-a[i]!=y)
                {
                    puts("NO");
                    return 0;
                }
            }
        }
        else if(a[i]==a[i+1])
        {
            puts("NO");
            return 0;
        }
        else
        {
            if(a[i]>a[i+1]+1)
            {
                if(y==-1)y=a[i]-a[i+1];
                if(a[i]-a[i+1]!=y)
                {
                    puts("NO");
                    return 0;
                }
            }
        }
    }
    sort(a+1,a+n+1);
    int tot=0,maxy=0;
    for(int i=1;i<=n;i++)
    {
        if(i==1||a[i]==a[i-1]+1)tot++;
        else tot=1;
        maxy=max(maxy,tot);
    }
    if(y==-1)y=a[n];
    x=a[n]/y+(a[n]%y!=0);
    if(x>=1&&y>=1&&y<=1e9&&x<=1e9&&maxy<=y)printf("YES\n%I64d %I64d\n",x,y);
    else puts("NO");
    return 0;
}


//#define debug
#include<bits/stdc++.h>
#define pb push_back
#define dbg(x) cout<<#x<<" = "<<(x)<<endl;
#define lson l,m,rt<<1
#define cmm(x) cout<<"("<<(x)<<")";
#define rson m+1,r,rt<<1|1
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll>PLL;
typedef pair<int,ll>Pil;
const ll INF = 0x3f3f3f3f;
const ll inf=0x7fffffff;
const double eps=1e-8;
const int maxn =1e5+10;
const int N = 510;
const ll mod=1e9+7;
const ll MOD=1e9;
//------
//define
map<ll,int>mp;
set<ll>S;
int a[maxn];
int y[maxn];
//solve
void solve() {
	int n;
	while(cin>>n) {
		int flag=0;
		ll x=MOD,y=-1;
		for(int i=0; i<n; i++) {
			cin>>a[i];
			if(mp.count(a[i])) {
				if(i<n-1||i&&a[i]==a[i-1]) {
					flag=1;
					continue;
				}
			} else {
				mp[a[i]]=1;
				if(i) {
					ll tmp=abs(a[i]-a[i-1]);
					y=max(tmp,y);
					S.insert(tmp);
				}
			}
		}
		if(flag||S.size()>2){
			cout<<"NO"<<endl;
		}else{
			cout<<"YES"<<endl<<x<<" "<<y<<endl;
		}
		mp.clear();
		S.clear();
	}
}

int main() {
	ios_base::sync_with_stdio(false);
#ifdef debug
	freopen("in.txt", "r", stdin);
//	freopen("out.txt","w",stdout);
#endif
	cin.tie(0);
	cout.tie(0);
	solve();
	/*
		#ifdef debug
			fclose(stdin);
			fclose(stdout);
			system("out.txt");
		#endif
	*/
	return 0;
}


//#define debug
#include<bits/stdc++.h>
#define pb push_back
#define dbg(x) cout<<#x<<" = "<<(x)<<endl;
#define lson l,m,rt<<1
#define cmm(x) cout<<"("<<(x)<<")";
#define rson m+1,r,rt<<1|1
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll>PLL;
typedef pair<int,ll>Pil;
const ll INF = 0x3f3f3f3f;
const ll inf=0x7fffffff;
const double eps=1e-8;
const int maxn =1e6+10;
const int N = 510;
const ll mod=1e9+7;
const ll MOD=1e9;
//------
//define
ll a[maxn];
//solve
void solve() {
	int n;
	while(cin>>n) {
		int flag=0;
		ll y=1;
		for(int i=0; i<n; i++) {
			cin>>a[i];
			if(!i)continue;
			if(a[i]==a[i-1])flag=1;
			y=max(y,abs(a[i]-a[i-1]));
		}
		for(int i=1; i<n; i++) {
			ll tmp=abs(a[i]-a[i-1]);
			if(tmp!=1&&tmp!=y){
				flag=1;
			//	cout<<"flag2"<<endl;
				break;
			}
			if(a[i]%y==0&&a[i-1]-a[i]==1&&y!=1){
				flag=1;
				break;
			}
			if(a[i]%y==1&&a[i]-a[i-1]==1&&y!=1){
				flag=1;
				break;
			}
		}
		if(flag){
			cout<<"NO"<<endl;
		}else{
			cout<<"YES"<<endl<<MOD<<" "<<y<<endl;
		}
	//	mp.clear();
	}
}

int main() {
	ios_base::sync_with_stdio(false);
#ifdef debug
	freopen("in.txt", "r", stdin);
//	freopen("out.txt","w",stdout);
#endif
	cin.tie(0);
	cout.tie(0);
	solve();
	/*
		#ifdef debug
			fclose(stdin);
			fclose(stdout);
			system("out.txt");
		#endif
	*/
	return 0;
}


//#define debug
#include<bits/stdc++.h>
#define pb push_back
#define dbg(x) cout<<#x<<" = "<<(x)<<endl;
#define lson l,m,rt<<1
#define cmm(x) cout<<"("<<(x)<<")";
#define rson m+1,r,rt<<1|1
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll>PLL;
typedef pair<int,ll>Pil;
const ll INF = 0x3f3f3f3f;
const ll inf=0x7fffffff;
const double eps=1e-8;
const int maxn =1e5+10;
const int N = 510;
const ll mod=1e9+7;
const ll MOD=1e9;
//------
//define
map<ll,int>mp;
set<ll>S;
int a[maxn];
int y[maxn];
//solve
void solve() {
	int n;
	while(cin>>n) {
		int flag=0;
		ll x=MOD,y=-1;
		for(int i=0; i<n; i++) {
			cin>>a[i];
			if(mp.count(a[i])) {
				if(i<n-1||i&&a[i]==a[i-1]) {
					flag=1;
					continue;
				}
			} else {
				mp[a[i]]=1;
				if(i) {
					ll tmp=abs(a[i]-a[i-1]);
					y=max(tmp,y);
					S.insert(tmp);
				}
			}
		}
		if(flag||S.size()>2){
			cout<<"NO"<<endl;
		}else if(S.size()==0){
			cout<<"YES"<<endl<<x<<" "<<a[0]<<endl;
		}
		else{
			cout<<"YES"<<endl<<x<<" "<<y<<endl;
		}
		mp.clear();
		S.clear();
	}
}

int main() {
	ios_base::sync_with_stdio(false);
#ifdef debug
	freopen("in.txt", "r", stdin);
//	freopen("out.txt","w",stdout);
#endif
	cin.tie(0);
	cout.tie(0);
	solve();
	/*
		#ifdef debug
			fclose(stdin);
			fclose(stdout);
			system("out.txt");
		#endif
	*/
	return 0;
}


//#define debug
#include<bits/stdc++.h>
#define pb push_back
#define dbg(x) cout<<#x<<" = "<<(x)<<endl;
#define lson l,m,rt<<1
#define cmm(x) cout<<"("<<(x)<<")";
#define rson m+1,r,rt<<1|1
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll>PLL;
typedef pair<int,ll>Pil;
const ll INF = 0x3f3f3f3f;
const ll inf=0x7fffffff;
const double eps=1e-8;
const int maxn =1e5+10;
const int N = 510;
const ll mod=1e9+7;
const ll MOD=1e9;
//------
//define
set<ll>S;
int a[maxn];
int y[maxn];
//solve
void solve() {
	int n;
	while(cin>>n) {
		ll x=MOD,y=-1;
		for(int i=1; i<=n; i++) {
			cin>>a[i];
			if(i>1) {
				ll tmp=abs(a[i]-a[i-1]);
				S.insert(tmp);
				y=max(y,tmp);
			}
		}
		if(S.size()>2) {
			cout<<"NO"<<endl;
		} else {
			cout<<"YES"<<endl;
			cout<<x<<" "<<y<<endl;
		}
		S.clear();
	}
}

int main() {
	ios_base::sync_with_stdio(false);
#ifdef debug
	freopen("in.txt", "r", stdin);
//	freopen("out.txt","w",stdout);
#endif
	cin.tie(0);
	cout.tie(0);
	solve();
	/*
		#ifdef debug
			fclose(stdin);
			fclose(stdout);
			system("out.txt");
		#endif
	*/
	return 0;
}


//#define debug
#include<bits/stdc++.h>
#define pb push_back
#define dbg(x) cout<<#x<<" = "<<(x)<<endl;
#define lson l,m,rt<<1
#define cmm(x) cout<<"("<<(x)<<")";
#define rson m+1,r,rt<<1|1
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll>PLL;
typedef pair<int,ll>Pil;
const ll INF = 0x3f3f3f3f;
const ll inf=0x7fffffff;
const double eps=1e-8;
const int maxn =1e6+10;
const int N = 510;
const ll mod=1e9+7;
const ll MOD=1e9;
//------
//define
ll a[maxn];
map<ll,int>mp;
//solve
void solve() {
	int n;
	while(cin>>n) {
		int flag=0;
		ll y=1;
		for(int i=0; i<n; i++) {
			cin>>a[i];
			if(!i)continue;
			if(a[i]==a[i-1])flag=1,cout<<"flag1"<<endl;
			y=max(y,abs(a[i]-a[i-1]));
		}
		for(int i=0; i<n-1; i++) {
			ll tmp=abs(a[i]-a[i+1]);
			if(tmp!=1&&tmp!=y){
				flag=1;
				cout<<"flag2"<<endl;
				break;
			}
			if(mp.count(a[i])){
				flag=1;
				cout<<"flag3"<<endl;
				break;
			}
			mp[a[i]]=1;
		}
		if(flag){
			cout<<"NO"<<endl;
		}else{
			cout<<"YES"<<endl<<MOD<<" "<<y<<endl;
		}
		mp.clear();
	}
}

int main() {
	ios_base::sync_with_stdio(false);
#ifdef debug
	freopen("in.txt", "r", stdin);
//	freopen("out.txt","w",stdout);
#endif
	cin.tie(0);
	cout.tie(0);
	solve();
	/*
		#ifdef debug
			fclose(stdin);
			fclose(stdout);
			system("out.txt");
		#endif
	*/
	return 0;
}


//#define debug
#include<bits/stdc++.h>
#define pb push_back
#define dbg(x) cout<<#x<<" = "<<(x)<<endl;
#define lson l,m,rt<<1
#define cmm(x) cout<<"("<<(x)<<")";
#define rson m+1,r,rt<<1|1
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll>PLL;
typedef pair<int,ll>Pil;
const ll INF = 0x3f3f3f3f;
const ll inf=0x7fffffff;
const double eps=1e-8;
const int maxn =1e6+10;
const int N = 510;
const ll mod=1e9+7;
const ll MOD=1e9;
//------
//define
map<ll,int>mp;
set<ll>S;
int a[maxn];
int y[maxn];
//solve
void solve() {
	int n;
	while(cin>>n) {
		int flag=0;
		ll x=MOD,y=-1;
		for(int i=0; i<n; i++) {
			cin>>a[i];
			if(mp.count(a[i])) {
				if(i<n-1||i&&a[i]==a[i-1]) {
					flag=1;
					continue;
				}
			} else {
				mp[a[i]]=1;
				if(i) {
					ll tmp=abs(a[i]-a[i-1]);
					y=max(tmp,y);
					S.insert(tmp);
				}
			}
		}
		if(flag||S.size()>2){
			cout<<"NO"<<endl;
		}else if(S.size()==0){
			cout<<"YES"<<endl<<x<<" "<<a[0]<<endl;
		}
		else{
			cout<<"YES"<<endl<<x<<" "<<y<<endl;
		}
		mp.clear();
		S.clear();
	}
}

int main() {
	ios_base::sync_with_stdio(false);
#ifdef debug
	freopen("in.txt", "r", stdin);
//	freopen("out.txt","w",stdout);
#endif
	cin.tie(0);
	cout.tie(0);
	solve();
	/*
		#ifdef debug
			fclose(stdin);
			fclose(stdout);
			system("out.txt");
		#endif
	*/
	return 0;
}


//#define debug
#include<bits/stdc++.h>
#define pb push_back
#define dbg(x) cout<<#x<<" = "<<(x)<<endl;
#define lson l,m,rt<<1
#define cmm(x) cout<<"("<<(x)<<")";
#define rson m+1,r,rt<<1|1
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll>PLL;
typedef pair<int,ll>Pil;
const ll INF = 0x3f3f3f3f;
const ll inf=0x7fffffff;
const double eps=1e-8;
const int maxn =1e6+10;
const int N = 510;
const ll mod=1e9+7;
const ll MOD=1e9;
//------
//define
ll a[maxn];
map<ll,int>mp;
//solve
void solve() {
	int n;
	while(cin>>n) {
		int flag=0;
		ll y=1;
		for(int i=0; i<n; i++) {
			cin>>a[i];
			if(!i)continue;
			if(a[i]==a[i-1])flag=1;
			y=max(y,abs(a[i]-a[i-1]));
		}
		for(int i=0; i<n-1; i++) {
			ll tmp=abs(a[i]-a[i+1]);
			if(tmp!=1&&tmp!=y){
				flag=1;
			//	cout<<"flag2"<<endl;
				break;
			}
			if(mp.count(a[i])){
				flag=1;
			//	cout<<"flag3"<<endl;
				break;
			}
			mp[a[i]]=1;
		}
		if(flag){
			cout<<"NO"<<endl;
		}else{
			cout<<"YES"<<endl<<MOD<<" "<<y<<endl;
		}
		mp.clear();
	}
}

int main() {
	ios_base::sync_with_stdio(false);
#ifdef debug
	freopen("in.txt", "r", stdin);
//	freopen("out.txt","w",stdout);
#endif
	cin.tie(0);
	cout.tie(0);
	solve();
	/*
		#ifdef debug
			fclose(stdin);
			fclose(stdout);
			system("out.txt");
		#endif
	*/
	return 0;
}


//#define debug
#include<bits/stdc++.h>
#define pb push_back
#define dbg(x) cout<<#x<<" = "<<(x)<<endl;
#define lson l,m,rt<<1
#define cmm(x) cout<<"("<<(x)<<")";
#define rson m+1,r,rt<<1|1
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll>PLL;
typedef pair<int,ll>Pil;
const ll INF = 0x3f3f3f3f;
const ll inf=0x7fffffff;
const double eps=1e-8;
const int maxn =1e6+10;
const int N = 510;
const ll mod=1e9+7;
const ll MOD=1e9;
//------
//define
map<ll,int>mp;
set<ll>S;
int a[maxn];
//solve
void solve() {
	int n;
	while(cin>>n) {
		int flag=0;
		ll x=MOD,y=-1;
		if(n==1) {
			ll tmp=0;
			cin>>tmp;
			cout<<"YES"<<endl;
			cout<<x<<" "<<tmp<<endl;
		} else {
			for(int i=0; i<n; i++) {
				cin>>a[i];
				if(mp.count(a[i])&&(mp[a[i]]==i-1||i<n-1)) {
					flag=1;
					continue;
				} else if(!mp.count(a[i])) {
					mp[a[i]]=i;
					if(i){
						ll tmp=abs(a[i]-a[i-1]);
						y=max(y,tmp);
						S.insert(tmp);
					}
				}
			//	cout<<i<<" "<<y<<endl;
			}
			if(flag||S.size()>2){
				cout<<"NO"<<endl;
			}else{
				cout<<"YES"<<endl<<x<<" "<<y<<endl;
			}
			mp.clear();
			S.clear();
		}
	}
}

int main() {
	ios_base::sync_with_stdio(false);
#ifdef debug
	freopen("in.txt", "r", stdin);
//	freopen("out.txt","w",stdout);
#endif
	cin.tie(0);
	cout.tie(0);
	solve();
	/*
		#ifdef debug
			fclose(stdin);
			fclose(stdout);
			system("out.txt");
		#endif
	*/
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
stack<char>q;
int a[200000+10];
int main(){
int n;
cin>>n;
for(int i=0;i<n;i++)scanf("%d",&a[i]);
int temp=-1;
int ok=1;
int x=a[0];
for(int i=1;i<n;i++){
	x=max(a[i],x);
	if(abs(a[i]-a[i-1])!=1){
	   if(temp==-1){
		   temp=abs(a[i]-a[i-1]);
	   }
	   else if(temp!=abs(a[i]-a[i-1])){
		   ok=0;
		   cout<<"NO\n";
		   break;
	   }
	}
}
if(temp==-1)temp=x;
if(ok)printf("YES\n%d %d\n",1000000000,temp);

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
stack<char>q;
int a[200000+10];
int main(){
int n;
cin>>n;
for(int i=0;i<n;i++)scanf("%d",&a[i]);
int temp=1;
int ok=1;
int x=a[0];
for(int i=1;i<n;i++){
	x=max(a[i],x);
	if(abs(a[i]-a[i-1])!=1){
	   if(temp==1){
		   temp=abs(a[i]-a[i-1]);
	   }
	   else if(temp!=abs(a[i]-a[i-1])){
		   ok=0;
		   cout<<"NO\n";
		   break;
	   }
	}
}

if(ok)printf("YES\n%d %d\n",1000000000,temp);

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
stack<char>q;
int a[200000+10];
int main(){
        int n;
        cin>>n;
        int u=-1;
        for(int i=0;i<n;i++){
            scanf("%d",&a[i]);
            if(abs(a[i]-a[i-1])>1){
                u=i;
            }
        }
        if(u==-1){
            cout<<"YES"<<endl;
            cout<<1000000000<<" "<<n<<endl;
            return 0;
        }
        bool can =true;
        int y=abs(a[u]-a[u-1]);
        for(int i=1;i<n;i++){
            if(abs(a[i]-a[i-1])!=1){
                if(abs(a[i]-a[i-1])%y!=0){
                    can = false;
                    break;
                }
            }else {
                if(a[i]-a[i-1]==1&&a[i-1]%y==0){
                    can=false;
                }
                if(a[i-1]-a[i]==1&&a[i]%y==0){
                    can=false;
                }
            }
        }
        if(can){
            cout<<"YES"<<endl;
            cout<<1000000000<<" "<<y<<endl;
            return 0;
        }else {
            cout<<"NO"<<endl;
            return 0;
        }

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
stack<char>q;
int a[200000+10];
int main(){
int n;
cin>>n;
for(int i=0;i<n;i++)scanf("%d",&a[i]);
int temp=1;
int ok=1;
int x=a[0];
for(int i=1;i<n;i++){
	x=max(a[i],x);
	if(a[i]==a[i-1]){
	  ok=0;
		   cout<<"NO\n";
		   break;
	}
	if(abs(a[i]-a[i-1])!=1){
	   if(temp==1){
		   temp=abs(a[i]-a[i-1]);
	   }
	   else if(temp!=abs(a[i]-a[i-1])){
		   ok=0;
		   cout<<"NO\n";
		   break;
	   }
	}
}

if(ok)printf("YES\n%d %d\n",1000000000,temp);

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
stack<char>q;
int a[200000+10];
int main(){
int n;
cin>>n;
for(int i=0;i<n;i++)scanf("%d",&a[i]);
int temp=1;
int ok=1;
int x=a[0];
for(int i=1;i<n;i++){
	if(abs(a[i]-a[i-1])!=1){
			temp=abs(a[i]-a[i-1]);
              break;
	}
}
for(int i=1;i<n;i++){
	if(a[i]==a[i-1]){
	  ok=0;
		   cout<<"NO\n";
		   break;
	}
	if(abs(a[i]-a[i-1])==1){
	   int  xx=ceil(a[i]*1.0/temp);
	   int yy=ceil(a[i-1]*1.0/temp);

	   if(xx!=yy){
           ok=0;
		   cout<<"NO\n";
		   break;
	   }
	}
	if(abs(a[i]-a[i-1])!=1){
	   if(temp==1){
		   temp=abs(a[i]-a[i-1]);
	   }
	   else if(temp!=abs(a[i]-a[i-1])){
		   ok=0;
		   cout<<"NO\n";
		   break;
	   }
	}
}

if(ok)printf("YES\n%d %d\n",1000000000,temp);

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
stack<char>q;
int a[200000+10];
int main(){
int n;
cin>>n;
for(int i=0;i<n;i++)scanf("%d",&a[i]);
int temp=-1;
int ok=1;
int x=a[0];
for(int i=1;i<n;i++){
	x=max(a[i],x);
	if(abs(a[i]-a[i-1])!=1){
	   if(temp==-1){
		   temp=abs(a[i]-a[i-1]);
	   }
	   else if(temp!=abs(a[i]-a[i-1])){
		   ok=0;
		   cout<<"NO\n";
		   break;
	   }
	}
}
if(ok)printf("YES\n%d %d\n",1000000000,temp);

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
stack<char>q;
int a[200000+10];
int main(){
int n;
cin>>n;
for(int i=0;i<n;i++)scanf("%d",&a[i]);
int temp=1;
int ok=1;
int x=a[0];
for(int i=1;i<n;i++){
	if(abs(a[i]-a[i-1])!=1){
			temp=abs(a[i]-a[i-1]);
              break;
	}
}
//cout<<temp<<endl;
for(int i=1;i<n;i++){
	if(a[i]==a[i-1]){
	  ok=0;
		   cout<<"NO\n";
		   break;
	}
	if(abs(a[i]-a[i-1])==1){
	   int  xx=a[i]/temp;
	   if(a[i]%temp==0)xx--;
       int yy=a[i-1]/temp;
	   if(a[i-1]%temp==0)yy--;
	  // cout<<xx<<"   "<<yy<<endl;

	   if(xx!=yy){
           ok=0;
		   cout<<"NO\n";
		   break;
	   }
	}
	if(abs(a[i]-a[i-1])!=1){
	   if(temp==1){
		   temp=abs(a[i]-a[i-1]);
	   }
	   else if(temp!=abs(a[i]-a[i-1])){
		   ok=0;
		   cout<<"NO\n";
		   break;
	   }
	}
}

if(ok)printf("YES\n%d %d\n",1000000000,temp);

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
stack<char>q;
int a[200000+10];
int main(){
        int n;
        cin>>n;
        int u=-1;
        bool k=true;
        for(int i=0;i<n;i++){
            scanf("%d",&a[i]);
            if(abs(a[i]-a[i-1])>1){
                u=i;
            }
            if(a[i]==a[i-1])k=false;
        }
        if(!k){
            cout<<"NO"<<endl;
            return 0;
        }
        if(u==-1){
            cout<<"YES"<<endl;
            cout<<1000000000<<" "<<n<<endl;
            return 0;
        }
        bool can =true;
        int y=abs(a[u]-a[u-1]);
        for(int i=1;i<n;i++){
            if(abs(a[i]-a[i-1])!=1){
                if(abs(a[i]-a[i-1])%y!=0){
                    can = false;
                    break;
                }
            }else {
                if(a[i]-a[i-1]==1&&a[i-1]%y==0){
                    can=false;
                }
                if(a[i-1]-a[i]==1&&a[i]%y==0){
                    can=false;
                }
            }
        }
        if(can){
            cout<<"YES"<<endl;
            cout<<1000000000<<" "<<y<<endl;
            return 0;
        }else {
            cout<<"NO"<<endl;
            return 0;
        }

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
stack<char>q;
int a[200000+10];
int main(){
int n;
cin>>n;
for(int i=0;i<n;i++)scanf("%d",&a[i]);
int temp=1;
int ok=1;
int x=a[0];

for(int i=1;i<n;i++){
	x=max(x,a[i]);
	if(a[i]==a[i-1]){
	  ok=0;
		   cout<<"NO\n";
		   return 0;
	}

	if(abs(a[i]-a[i-1])!=1){
	   if(temp==1){
		   temp=abs(a[i]-a[i-1]);
	   }
	   else if(temp!=abs(a[i]-a[i-1])){
		   ok=0;
		   cout<<"NO\n";
		  return 0;
	   }
	}
}

if(temp==1)temp=x;

if(ok){
for(int i=1;i<n;i++){
if(abs(a[i]-a[i-1])==1){
	   int  xx=a[i]/temp;
	   if(a[i]%temp==0)xx--;
       int yy=a[i-1]/temp;
	   if(a[i-1]%temp==0)yy--;
	   if(xx!=yy){
           ok=0;
		   cout<<"NO\n";
		   return 0;
	   }
}
}

printf("YES\n%d %d\n",1000000000,temp);
}

	return 0;
}


#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define per(i,a,b) for(int i=a;i>b;i--)
#define repLL(i,a,b) for(LL i=(LL)a;i<(LL)b;i++)
#define perLL(i,a,b) for(LL i=(LL)a;i>(LL)b;i--)
#define debug5(a,b,c,d,e) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<" "<<#d<<": "<<d<<" "<<#e<<": "<<e<<endl;
#define debug4(a,b,c,d)  cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<" "<<#d<<": "<<d<<endl;
#define debug3(a,b,c) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<endl;
#define debug2(a,b) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<endl;
#define debug(a) cerr<<#a<<": "<<a<<endl;
#define pb push_back
#define mp make_pair
#define SZ(x) ((int)(x).size())
#define ALL(x) x.begin(),x.end()
#define fi first
#define se second
#define _upgrade ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;

typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector<LL> VLL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef long double LD;
typedef pair<LD,LD> PLD;
typedef vector<LD> VLD;
typedef vector<PLD> VPLD;

template<typename T>
void dbg(T a)
{
      #ifdef LOCAL
            cerr<<a<<"\n";
      #endif
}

template<typename T, typename ...Arg>
void dbg(T a,Arg ...arg)
{
      #ifdef LOCAL
            cerr<<a<<" ";
            dbg(arg...);
      #endif
}

const int maxn=(1e6)+7;
const int inf=(1e9)+7;
const LL LLinf=(1e18)+7;
const LD eps=1e-9;
const LL mod=1e9+7;

// ***************************** CODE ***************************** //

int tab[maxn];
VI nie;

int main()
{
      _upgrade
      int n;
      cin>>n;
      for(int i = 0 ;i < n;i++)
            cin>>tab[i];
      int gc = 0;
      for(int i = 0 ;i < n - 1;i++)
      {
            if(abs(tab[i] - tab[i + 1]) == 1)
                  nie.pb(min(tab[i], tab[i + 1]));
            else
            {
                  if(gc > 0 && gc != abs(tab[i] - tab[i + 1]))
                  {
                        cout<<"NO";
                        return 0;
                  }
                  gc = abs(tab[i] - tab[i + 1]);
            }
      }
      if(gc == 0)
      {
            assert(0);
            cout<<"YES\n";
            cout<<"1000000000 1000000000\n";
            return 0;
      }
      for(auto s : nie)
            if( s % gc == 0)
            {
                  cout<<"NO";
                  return 0;
            }
      cout<<"YES\n1000000000 "<<gc<<"\n";

      return 0;
}


#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define per(i,a,b) for(int i=a;i>b;i--)
#define repLL(i,a,b) for(LL i=(LL)a;i<(LL)b;i++)
#define perLL(i,a,b) for(LL i=(LL)a;i>(LL)b;i--)
#define debug5(a,b,c,d,e) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<" "<<#d<<": "<<d<<" "<<#e<<": "<<e<<endl;
#define debug4(a,b,c,d)  cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<" "<<#d<<": "<<d<<endl;
#define debug3(a,b,c) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<endl;
#define debug2(a,b) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<endl;
#define debug(a) cerr<<#a<<": "<<a<<endl;
#define pb push_back
#define mp make_pair
#define SZ(x) ((int)(x).size())
#define ALL(x) x.begin(),x.end()
#define fi first
#define se second
#define _upgrade ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;

typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector<LL> VLL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef long double LD;
typedef pair<LD,LD> PLD;
typedef vector<LD> VLD;
typedef vector<PLD> VPLD;

template<typename T>
void dbg(T a)
{
      #ifdef LOCAL
            cerr<<a<<"\n";
      #endif
}

template<typename T, typename ...Arg>
void dbg(T a,Arg ...arg)
{
      #ifdef LOCAL
            cerr<<a<<" ";
            dbg(arg...);
      #endif
}

const int maxn=(1e6)+7;
const int inf=(1e9)+7;
const LL LLinf=(1e18)+7;
const LD eps=1e-9;
const LL mod=1e9+7;

// ***************************** CODE ***************************** //

int tab[maxn];
VI nie;

int main()
{
      _upgrade
      int n;
      cin>>n;
      for(int i = 0 ;i < n;i++)
            cin>>tab[i];
      int gc = 0;
      for(int i = 0 ;i < n - 1;i++)
      {
            if(tab[i] == tab[i + 1])
            {
                  cout<<"NO";
                  return 0;
            }
            if(abs(tab[i] - tab[i + 1]) == 1)
                  nie.pb(min(tab[i], tab[i + 1]));
            else
            {
                  if(gc > 0 && gc != abs(tab[i] - tab[i + 1]))
                  {
                        cout<<"NO";
                        return 0;
                  }
                  gc = abs(tab[i] - tab[i + 1]);
            }
      }
      if(gc == 0)
      {
            cout<<"YES\n";
            cout<<"1000000000 1000000000\n";
            return 0;
      }
      for(auto s : nie)
            if( s % gc == 0)
            {
                  cout<<"NO";
                  return 0;
            }
      cout<<"YES\n1000000000 "<<gc<<"\n";

      return 0;
}


#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define per(i,a,b) for(int i=a;i>b;i--)
#define repLL(i,a,b) for(LL i=(LL)a;i<(LL)b;i++)
#define perLL(i,a,b) for(LL i=(LL)a;i>(LL)b;i--)
#define debug5(a,b,c,d,e) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<" "<<#d<<": "<<d<<" "<<#e<<": "<<e<<endl;
#define debug4(a,b,c,d)  cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<" "<<#d<<": "<<d<<endl;
#define debug3(a,b,c) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<endl;
#define debug2(a,b) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<endl;
#define debug(a) cerr<<#a<<": "<<a<<endl;
#define pb push_back
#define mp make_pair
#define SZ(x) ((int)(x).size())
#define ALL(x) x.begin(),x.end()
#define fi first
#define se second
#define _upgrade ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;

typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector<LL> VLL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef long double LD;
typedef pair<LD,LD> PLD;
typedef vector<LD> VLD;
typedef vector<PLD> VPLD;

template<typename T>
void dbg(T a)
{
      #ifdef LOCAL
            cerr<<a<<"\n";
      #endif
}

template<typename T, typename ...Arg>
void dbg(T a,Arg ...arg)
{
      #ifdef LOCAL
            cerr<<a<<" ";
            dbg(arg...);
      #endif
}

const int maxn=(1e6)+7;
const int inf=(1e9)+7;
const LL LLinf=(1e18)+7;
const LD eps=1e-9;
const LL mod=1e9+7;

// ***************************** CODE ***************************** //

int tab[maxn];
VI nie;

int main()
{
      _upgrade
      int n;
      cin>>n;
      for(int i = 0 ;i < n;i++)
            cin>>tab[i];
      int gc = 0;
      for(int i = 0 ;i < n - 1;i++)
      {
            if(abs(tab[i] - tab[i + 1]) == 1)
                  nie.pb(abs(tab[i] - tab[i + 1]));
            else
                  gc = __gcd(gc, abs(tab[i] - tab[i + 1]));
      }

      for(auto s : nie)
            if(s % gc == 0)
            {
                  cout<<"NO";
                  return 0;
            }
      cout<<"YES"<<endl;
      cout<<gc<<" "<<1000000000;

      return 0;
}


#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define per(i,a,b) for(int i=a;i>b;i--)
#define repLL(i,a,b) for(LL i=(LL)a;i<(LL)b;i++)
#define perLL(i,a,b) for(LL i=(LL)a;i>(LL)b;i--)
#define debug5(a,b,c,d,e) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<" "<<#d<<": "<<d<<" "<<#e<<": "<<e<<endl;
#define debug4(a,b,c,d)  cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<" "<<#d<<": "<<d<<endl;
#define debug3(a,b,c) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<endl;
#define debug2(a,b) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<endl;
#define debug(a) cerr<<#a<<": "<<a<<endl;
#define pb push_back
#define mp make_pair
#define SZ(x) ((int)(x).size())
#define ALL(x) x.begin(),x.end()
#define fi first
#define se second
#define _upgrade ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;

typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector<LL> VLL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef long double LD;
typedef pair<LD,LD> PLD;
typedef vector<LD> VLD;
typedef vector<PLD> VPLD;

template<typename T>
void dbg(T a)
{
      #ifdef LOCAL
            cerr<<a<<"\n";
      #endif
}

template<typename T, typename ...Arg>
void dbg(T a,Arg ...arg)
{
      #ifdef LOCAL
            cerr<<a<<" ";
            dbg(arg...);
      #endif
}

const int maxn=(1e6)+7;
const int inf=(1e9)+7;
const LL LLinf=(1e18)+7;
const LD eps=1e-9;
const LL mod=1e9+7;

// ***************************** CODE ***************************** //

int tab[maxn];
VI nie;

int main()
{
      _upgrade
      int n;
      cin>>n;
      for(int i = 0 ;i < n;i++)
            cin>>tab[i];
      int gc = 0;
      for(int i = 0 ;i < n - 1;i++)
      {
            if(abs(tab[i] - tab[i + 1]) == 1)
                  nie.pb(abs(tab[i] - tab[i + 1]));
            else
                  gc = __gcd(gc, abs(tab[i] - tab[i + 1]));
      }
      if(gc == 0)
      {
            cout<<"YES\n";
            cout<<1<<" "<<1000000000<<"\n";
      }
      for(auto s : nie)
            if(s % gc == 0)
            {
                  cout<<"NO";
                  return 0;
            }
      cout<<"YES\n";
      cout<<1000000000<<" "<<gc<<"\n";

      return 0;
}


#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define per(i,a,b) for(int i=a;i>b;i--)
#define repLL(i,a,b) for(LL i=(LL)a;i<(LL)b;i++)
#define perLL(i,a,b) for(LL i=(LL)a;i>(LL)b;i--)
#define debug5(a,b,c,d,e) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<" "<<#d<<": "<<d<<" "<<#e<<": "<<e<<endl;
#define debug4(a,b,c,d)  cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<" "<<#d<<": "<<d<<endl;
#define debug3(a,b,c) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<endl;
#define debug2(a,b) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<endl;
#define debug(a) cerr<<#a<<": "<<a<<endl;
#define pb push_back
#define mp make_pair
#define SZ(x) ((int)(x).size())
#define ALL(x) x.begin(),x.end()
#define fi first
#define se second
#define _upgrade ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;

typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector<LL> VLL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef long double LD;
typedef pair<LD,LD> PLD;
typedef vector<LD> VLD;
typedef vector<PLD> VPLD;

template<typename T>
void dbg(T a)
{
      #ifdef LOCAL
            cerr<<a<<"\n";
      #endif
}

template<typename T, typename ...Arg>
void dbg(T a,Arg ...arg)
{
      #ifdef LOCAL
            cerr<<a<<" ";
            dbg(arg...);
      #endif
}

const int maxn=(1e6)+7;
const int inf=(1e9)+7;
const LL LLinf=(1e18)+7;
const LD eps=1e-9;
const LL mod=1e9+7;

// ***************************** CODE ***************************** //

int tab[maxn];
VI nie;

int main()
{
      _upgrade
      int n;
      cin>>n;
      for(int i = 0 ;i < n;i++)
            cin>>tab[i];
      int gc = 0;
      for(int i = 0 ;i < n;i++)
      {
            if(abs(tab[i] - tab[(i + 1)%n]) == 1)
                  nie.pb(min(tab[i], tab[(i + 1)%n]));
            else
            {
                  if(gc > 0 && gc != abs(tab[i] - tab[(i + 1)%n]))
                  {
                        cout<<"NO";
                        return 0;
                  }
                  gc = abs(tab[i] - tab[(i + 1)%n]);
            }
      }
      if(gc == 0)
      {
            cout<<"YES\n";
            cout<<1000000000<<" "<<1000000000<<"\n";
            return 0;
      }
      for(auto s : nie)
            if(s % gc == 0)
            {
                  cout<<"NO";
                  return 0;
            }
      cout<<"YES\n";
      cout<<1000000000<<" "<<gc<<"\n";

      return 0;
}


#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define per(i,a,b) for(int i=a;i>b;i--)
#define repLL(i,a,b) for(LL i=(LL)a;i<(LL)b;i++)
#define perLL(i,a,b) for(LL i=(LL)a;i>(LL)b;i--)
#define debug5(a,b,c,d,e) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<" "<<#d<<": "<<d<<" "<<#e<<": "<<e<<endl;
#define debug4(a,b,c,d)  cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<" "<<#d<<": "<<d<<endl;
#define debug3(a,b,c) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<endl;
#define debug2(a,b) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<endl;
#define debug(a) cerr<<#a<<": "<<a<<endl;
#define pb push_back
#define mp make_pair
#define SZ(x) ((int)(x).size())
#define ALL(x) x.begin(),x.end()
#define fi first
#define se second
#define _upgrade ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;

typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector<LL> VLL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef long double LD;
typedef pair<LD,LD> PLD;
typedef vector<LD> VLD;
typedef vector<PLD> VPLD;

template<typename T>
void dbg(T a)
{
      #ifdef LOCAL
            cerr<<a<<"\n";
      #endif
}

template<typename T, typename ...Arg>
void dbg(T a,Arg ...arg)
{
      #ifdef LOCAL
            cerr<<a<<" ";
            dbg(arg...);
      #endif
}

const int maxn=(1e6)+7;
const int inf=(1e9)+7;
const LL LLinf=(1e18)+7;
const LD eps=1e-9;
const LL mod=1e9+7;

// ***************************** CODE ***************************** //

int tab[maxn];
VI nie;

int main()
{
      _upgrade
      int n;
      cin>>n;
      for(int i = 0 ;i < n;i++)
            cin>>tab[i];
      int gc = 0;
      for(int i = 0 ;i < n - 1;i++)
      {
            if(abs(tab[i] - tab[i + 1]) == 1)
                  nie.pb(min(tab[i], tab[i + 1]));
            else
                  gc = __gcd(gc, abs(tab[i] - tab[i + 1]));
      }
      if(gc == 0)
      {
            cout<<"YES\n";
            cout<<1000000000<<" "<<1000000000<<"\n";
            return 0;
      }
      for(auto s : nie)
            if(s % gc == 0)
            {
                  cout<<"NO";
                  return 0;
            }
      cout<<"YES\n";
      cout<<1000000000<<" "<<gc<<"\n";

      return 0;
}


#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define per(i,a,b) for(int i=a;i>b;i--)
#define repLL(i,a,b) for(LL i=(LL)a;i<(LL)b;i++)
#define perLL(i,a,b) for(LL i=(LL)a;i>(LL)b;i--)
#define debug5(a,b,c,d,e) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<" "<<#d<<": "<<d<<" "<<#e<<": "<<e<<endl;
#define debug4(a,b,c,d)  cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<" "<<#d<<": "<<d<<endl;
#define debug3(a,b,c) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<endl;
#define debug2(a,b) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<endl;
#define debug(a) cerr<<#a<<": "<<a<<endl;
#define pb push_back
#define mp make_pair
#define SZ(x) ((int)(x).size())
#define ALL(x) x.begin(),x.end()
#define fi first
#define se second
#define _upgrade ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;

typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector<LL> VLL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef long double LD;
typedef pair<LD,LD> PLD;
typedef vector<LD> VLD;
typedef vector<PLD> VPLD;

template<typename T>
void dbg(T a)
{
      #ifdef LOCAL
            cerr<<a<<"\n";
      #endif
}

template<typename T, typename ...Arg>
void dbg(T a,Arg ...arg)
{
      #ifdef LOCAL
            cerr<<a<<" ";
            dbg(arg...);
      #endif
}

const int maxn=(1e6)+7;
const int inf=(1e9)+7;
const LL LLinf=(1e18)+7;
const LD eps=1e-9;
const LL mod=1e9+7;

// ***************************** CODE ***************************** //

int tab[maxn];
VI nie;

int main()
{
      _upgrade
      int n;
      cin>>n;
      for(int i = 0 ;i < n;i++)
            cin>>tab[i];
      int gc = 0;
      for(int i = 0 ;i < n - 1;i++)
      {
            if(abs(tab[i] - tab[i + 1]) == 1)
                  nie.pb(min(tab[i], tab[i + 1]));
            else
                  gc = __gcd(gc, abs(tab[i] - tab[i + 1]));
      }
      if(gc == 0)
      {
            cout<<"YES\n";
            cout<<1<<" "<<1000000000<<"\n";
            return 0;
      }
      for(auto s : nie)
            if(s % gc == 0)
            {
                  cout<<"NO";
                  return 0;
            }
      cout<<"YES\n";
      cout<<1000000000<<" "<<gc<<"\n";

      return 0;
}


#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define per(i,a,b) for(int i=a;i>b;i--)
#define repLL(i,a,b) for(LL i=(LL)a;i<(LL)b;i++)
#define perLL(i,a,b) for(LL i=(LL)a;i>(LL)b;i--)
#define debug5(a,b,c,d,e) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<" "<<#d<<": "<<d<<" "<<#e<<": "<<e<<endl;
#define debug4(a,b,c,d)  cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<" "<<#d<<": "<<d<<endl;
#define debug3(a,b,c) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<endl;
#define debug2(a,b) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<endl;
#define debug(a) cerr<<#a<<": "<<a<<endl;
#define pb push_back
#define mp make_pair
#define SZ(x) ((int)(x).size())
#define ALL(x) x.begin(),x.end()
#define fi first
#define se second
#define _upgrade ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;

typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector<LL> VLL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef long double LD;
typedef pair<LD,LD> PLD;
typedef vector<LD> VLD;
typedef vector<PLD> VPLD;

template<typename T>
void dbg(T a)
{
      #ifdef LOCAL
            cerr<<a<<"\n";
      #endif
}

template<typename T, typename ...Arg>
void dbg(T a,Arg ...arg)
{
      #ifdef LOCAL
            cerr<<a<<" ";
            dbg(arg...);
      #endif
}

const int maxn=(1e6)+7;
const int inf=(1e9)+7;
const LL LLinf=(1e18)+7;
const LD eps=1e-9;
const LL mod=1e9+7;

// ***************************** CODE ***************************** //

int tab[maxn];
VI nie;

int main()
{
      _upgrade
      int n;
      cin>>n;
      for(int i = 0 ;i < n;i++)
            cin>>tab[i];
      int gc = 0;
      for(int i = 0 ;i < n - 1;i++)
      {
            if(abs(tab[i] - tab[i + 1]) == 1)
                  nie.pb(abs(tab[i] - tab[i + 1]));
            else
                  gc = __gcd(gc, abs(tab[i] - tab[i + 1]));
      }
      if(gc == 0)
      {
            cout<<"YES\n";
            cout<<1<<" "<<1000000000<<"\n";
            return 0;
      }
      for(auto s : nie)
            if(s % gc == 0)
            {
                  cout<<"NO";
                  return 0;
            }
      cout<<"YES\n";
      cout<<1000000000<<" "<<gc<<"\n";

      return 0;
}


#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define per(i,a,b) for(int i=a;i>b;i--)
#define repLL(i,a,b) for(LL i=(LL)a;i<(LL)b;i++)
#define perLL(i,a,b) for(LL i=(LL)a;i>(LL)b;i--)
#define debug5(a,b,c,d,e) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<" "<<#d<<": "<<d<<" "<<#e<<": "<<e<<endl;
#define debug4(a,b,c,d)  cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<" "<<#d<<": "<<d<<endl;
#define debug3(a,b,c) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<endl;
#define debug2(a,b) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<endl;
#define debug(a) cerr<<#a<<": "<<a<<endl;
#define pb push_back
#define mp make_pair
#define SZ(x) ((int)(x).size())
#define ALL(x) x.begin(),x.end()
#define fi first
#define se second
#define _upgrade ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;

typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector<LL> VLL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef long double LD;
typedef pair<LD,LD> PLD;
typedef vector<LD> VLD;
typedef vector<PLD> VPLD;

template<typename T>
void dbg(T a)
{
      #ifdef LOCAL
            cerr<<a<<"\n";
      #endif
}

template<typename T, typename ...Arg>
void dbg(T a,Arg ...arg)
{
      #ifdef LOCAL
            cerr<<a<<" ";
            dbg(arg...);
      #endif
}

const int maxn=(1e6)+7;
const int inf=(1e9)+7;
const LL LLinf=(1e18)+7;
const LD eps=1e-9;
const LL mod=1e9+7;

// ***************************** CODE ***************************** //

int tab[maxn];
VI nie;

int main()
{
      _upgrade
      int n;
      cin>>n;
      for(int i = 0 ;i < n;i++)
            cin>>tab[i];
      int gc = 0;
      for(int i = 0 ;i < n - 1;i++)
      {
            if(abs(tab[i] - tab[i + 1]) == 1)
                  nie.pb(min(tab[i], tab[i + 1]));
            else
            {
                  if(gc > 0 && gc != abs(tab[i] - tab[i + 1]))
                  {
                        cout<<"NO";
                        return 0;
                  }
                  gc = abs(tab[i] - tab[i + 1]);
            }
      }
      if(gc == 0)
      {
            cout<<"YES\n";
            cout<<1000000000<<" "<<1000000000<<"\n";
            return 0;
      }
      for(auto s : nie)
            if(gc != 1 && s % gc == 0)
            {
                  cout<<"NO";
                  return 0;
            }
      cout<<"YES\n";
      cout<<1000000000<<" "<<gc<<"\n";

      return 0;
}


#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define per(i,a,b) for(int i=a;i>b;i--)
#define repLL(i,a,b) for(LL i=(LL)a;i<(LL)b;i++)
#define perLL(i,a,b) for(LL i=(LL)a;i>(LL)b;i--)
#define debug5(a,b,c,d,e) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<" "<<#d<<": "<<d<<" "<<#e<<": "<<e<<endl;
#define debug4(a,b,c,d)  cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<" "<<#d<<": "<<d<<endl;
#define debug3(a,b,c) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<" "<<#c<<": "<<c<<endl;
#define debug2(a,b) cerr<<#a<<": "<<a<<" "<<#b<<": "<<b<<endl;
#define debug(a) cerr<<#a<<": "<<a<<endl;
#define pb push_back
#define mp make_pair
#define SZ(x) ((int)(x).size())
#define ALL(x) x.begin(),x.end()
#define fi first
#define se second
#define _upgrade ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;

typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector<LL> VLL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef long double LD;
typedef pair<LD,LD> PLD;
typedef vector<LD> VLD;
typedef vector<PLD> VPLD;

template<typename T>
void dbg(T a)
{
      #ifdef LOCAL
            cerr<<a<<"\n";
      #endif
}

template<typename T, typename ...Arg>
void dbg(T a,Arg ...arg)
{
      #ifdef LOCAL
            cerr<<a<<" ";
            dbg(arg...);
      #endif
}

const int maxn=(1e6)+7;
const int inf=(1e9)+7;
const LL LLinf=(1e18)+7;
const LD eps=1e-9;
const LL mod=1e9+7;

// ***************************** CODE ***************************** //

int tab[maxn];
VI nie;

int main()
{
      _upgrade
      int n;
      cin>>n;
      for(int i = 0 ;i < n;i++)
            cin>>tab[i];
      int gc = 0;
      for(int i = 0 ;i < n - 1;i++)
      {
            if(abs(tab[i] - tab[i + 1]) == 1)
                  nie.pb(min(tab[i], tab[i + 1]));
            else
                  gc = __gcd(gc, abs(tab[i] - tab[i + 1]));
      }
      if(gc == 0)
      {
            cout<<"YES\n";
            cout<<1000000000<<" "<<1000000000<<"\n";
            return 0;
      }
      for(auto s : nie)
            if(gc != 1 && s % gc == 0)
            {
                  cout<<"NO";
                  return 0;
            }
      cout<<"YES\n";
      cout<<1000000000<<" "<<gc<<"\n";

      return 0;
}


#include <bits/stdc++.h>
#define SIZE 1000007
#define MOD 1000000007
#define pi 3.14159265359
using namespace std;

vector<int> pri;
void sieve(){
    bool f[SIZE];
    f[0] = f[1] = 1;
    for(int i=2; i<SIZE; ++i){ if( f[i] ) continue;
        pri.push_back(i);
    for(int j = i*i; i<=10000 && j<SIZE; j += i) f[j] = 1;}}

bool prime(int x) {
if ( x==2)  return true;
if ( x<2 || x%2==0 )  return false;
	for (int i = 3; i *i <= x; i+=2) if (x%i == 0)  return false;  return true; }

vector<int> factor;
void GetFactor(int n){
    for(int i=2; i<=n/i; ++i){
        while( n % i == 0 ){
            factor.push_back(i);
            n /= i;
        }
    }if(n!=1)factor.push_back(n);
}

long long MaxSubarray(long long arr[], int n){
    long long best = -1e18, sum = 0;
    for(int i=0; i<n; ++i){
        sum = max( arr[i], arr[i] + sum );
        best = max( best, sum );
    } return best;
}

long long GCD(long long a, long long b){
    return b ? GCD(b, a%b) : a ;
}
long long LCM(long long a, long long b){
    return a / GCD(a, b) * b;
}

long long fast_power(long long b, long long p){
    long long res=1;
    while(p){
        if(p%2) res = ( res * b ) % MOD;
        b = ( b * b ) % MOD;
        p /= 2;
    }
    return res;
}
bool isvalid ( int r , int c , int R , int C)
{
    return ( r >= 0 && r < R && c >= 0 && c < C);
}
int dx[]= {-1, 1, 0, 0};
int dy[]= {0, 0, 1, -1};
#define ll long long
#define ull unsigned long long
#define lld long long double
#define sz(v)   ((int)((v).size()))
#define sortv(v) sort(v.begin(),v.end());
#define all(v) ((v).begin()), ((v).end())
#define rev(x) reverse(x.begin(),x.end())

#define fr(c,x,n)  for(int c=x;c<n;++c)
#define fz(c,n)  for(int c=0;c< n ;++c)
#define fo(c,n) for(int c = 1; c < n; ++c)
#define fn(c,n) for (int c = n; c>=0; ++c)
#define MNX ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

int main()
{
ll n , a  , x , f = 1 , maxi = -1 ;
set < long long  > st;

cin>>n;
fz ( i,n )
{
    cin>>x;
    if (i==0)
        a = x ;
    else
    {
         if ( abs ( a-x) == 0  )
            f = 0 ;

        if ( f!= 0 )
        {
        st.insert(abs(a-x));
        a = x ;
        }
    }
     maxi = max ( x , maxi );
}
if ( n== 1)
{

    cout<<"YES\n"<<x<<" "<<1;
}
else if ( f == 0 || st.size() > 2  )
{
    cout<<"NO";
}
else if ( st.size() == 1 )
{
    ll ans = maxi / (*st.begin());
    if ( maxi % (*st.begin()) != 0  )
         ans++;
    if  ( ans * (*st.begin()) <= 1e9)
    cout<<"YES\n"<<ans<<" "<<*st.begin();
    else
    cout<<"NO";
}
else
{
    ll ans = maxi / (*st.rbegin());
    if ( maxi % (*st.rbegin()) != 0  )
         ans++;
    if (*st.begin() == 1 && ( ans * (*st.rbegin()) <= 1e9))
    cout<<"YES\n"<<ans<<" "<<*st.rbegin();
    else
    cout<<"NO";

}}


#include <bits/stdc++.h>
#define SIZE 1000007
#define MOD 1000000007
#define pi 3.14159265359
using namespace std;

vector<int> pri;
void sieve(){
    bool f[SIZE];
    f[0] = f[1] = 1;
    for(int i=2; i<SIZE; ++i){ if( f[i] ) continue;
        pri.push_back(i);
    for(int j = i*i; i<=10000 && j<SIZE; j += i) f[j] = 1;}}

bool prime(int x) {
if ( x==2)  return true;
if ( x<2 || x%2==0 )  return false;
	for (int i = 3; i *i <= x; i+=2) if (x%i == 0)  return false;  return true; }

vector<int> factor;
void GetFactor(int n){
    for(int i=2; i<=n/i; ++i){
        while( n % i == 0 ){
            factor.push_back(i);
            n /= i;
        }
    }if(n!=1)factor.push_back(n);
}

long long MaxSubarray(long long arr[], int n){
    long long best = -1e18, sum = 0;
    for(int i=0; i<n; ++i){
        sum = max( arr[i], arr[i] + sum );
        best = max( best, sum );
    } return best;
}

long long GCD(long long a, long long b){
    return b ? GCD(b, a%b) : a ;
}
long long LCM(long long a, long long b){
    return a / GCD(a, b) * b;
}

long long fast_power(long long b, long long p){
    long long res=1;
    while(p){
        if(p%2) res = ( res * b ) % MOD;
        b = ( b * b ) % MOD;
        p /= 2;
    }
    return res;
}
bool isvalid ( int r , int c , int R , int C)
{
    return ( r >= 0 && r < R && c >= 0 && c < C);
}
int dx[]= {-1, 1, 0, 0};
int dy[]= {0, 0, 1, -1};
#define ll long long
#define ull unsigned long long
#define lld long long double
#define sz(v)   ((int)((v).size()))
#define sortv(v) sort(v.begin(),v.end());
#define all(v) ((v).begin()), ((v).end())
#define rev(x) reverse(x.begin(),x.end())

#define fr(c,x,n)  for(int c=x;c<n;++c)
#define fz(c,n)  for(int c=0;c< n ;++c)
#define fo(c,n) for(int c = 1; c < n; ++c)
#define fn(c,n) for (int c = n; c>=0; ++c)
#define MNX ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

int main()
{
ll n , a  , x , f = 1 , maxi = -1 ;
set < long long  > st;

cin>>n;
fz ( i,n )
{
    cin>>x;
    if (i==0)
        a = x ;
    else
    {
         if ( abs ( a-x) == 0  )
            f = 0 ;

        if ( f!= 0 )
        {
        st.insert(abs(a-x));
        a = x ;
        }
    }
     maxi = max ( x , maxi );
}
if ( n== 1)
{
    cout<<"YES\n"<<1<<" "<<1000000000;
}
else if ( f == 0 || st.size() > 2  )
{
    cout<<"NO";
}
else if ( st.size() == 1 )
{
    ll ans = maxi / (*st.begin());
    if ( maxi  % (*st.begin()))
        ans++;
    if ( ans * (*st.begin()) <= 1000000000)
    cout<<"YES\n"<<ans<<" "<<*st.begin();
    else
    cout<<"NO";
}
else
{
    if (*st.begin() == 1)
    {
    ll ans = maxi / (*st.rbegin());
    if ( maxi  % (*st.rbegin()))
        ans++;
    if ( ans * (*st.rbegin()) <= 1000000000)
    cout<<"YES\n"<<ans<<" "<<*st.rbegin();
    else
    cout<<"NO";
    }
    else
    cout<<"NO";
}

}


#include <bits/stdc++.h>
#define SIZE 1000007
#define MOD 1000000007
#define pi 3.14159265359
using namespace std;

vector<int> pri;
void sieve(){
    bool f[SIZE];
    f[0] = f[1] = 1;
    for(int i=2; i<SIZE; ++i){ if( f[i] ) continue;
        pri.push_back(i);
    for(int j = i*i; i<=10000 && j<SIZE; j += i) f[j] = 1;}}

bool prime(int x) {
if ( x==2)  return true;
if ( x<2 || x%2==0 )  return false;
	for (int i = 3; i *i <= x; i+=2) if (x%i == 0)  return false;  return true; }

vector<int> factor;
void GetFactor(int n){
    for(int i=2; i<=n/i; ++i){
        while( n % i == 0 ){
            factor.push_back(i);
            n /= i;
        }
    }if(n!=1)factor.push_back(n);
}

long long MaxSubarray(long long arr[], int n){
    long long best = -1e18, sum = 0;
    for(int i=0; i<n; ++i){
        sum = max( arr[i], arr[i] + sum );
        best = max( best, sum );
    } return best;
}

long long GCD(long long a, long long b){
    return b ? GCD(b, a%b) : a ;
}
long long LCM(long long a, long long b){
    return a / GCD(a, b) * b;
}

long long fast_power(long long b, long long p){
    long long res=1;
    while(p){
        if(p%2) res = ( res * b ) % MOD;
        b = ( b * b ) % MOD;
        p /= 2;
    }
    return res;
}
bool isvalid ( int r , int c , int R , int C)
{
    return ( r >= 0 && r < R && c >= 0 && c < C);
}
int dx[]= {-1, 1, 0, 0};
int dy[]= {0, 0, 1, -1};
#define ll long long
#define ull unsigned long long
#define lld long long double
#define sz(v)   ((int)((v).size()))
#define sortv(v) sort(v.begin(),v.end());
#define all(v) ((v).begin()), ((v).end())
#define rev(x) reverse(x.begin(),x.end())

#define fr(c,x,n)  for(int c=x;c<n;++c)
#define fz(c,n)  for(int c=0;c< n ;++c)
#define fo(c,n) for(int c = 1; c < n; ++c)
#define fn(c,n) for (int c = n; c>=0; ++c)
#define MNX ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

set < long long  > st;

int main()
{
ll n , a  , x , f = 1 ;
cin>>n;
fz ( i,n )
{
    cin>>x;
    if (!i)
    {
        a = x ;
    }
    else
    {
         if ( abs ( a-x) == 0 )
            {f = 0 ; break; }
        st.insert(abs(a-x));
        a = x ;

    }
}
if ( f== 0 || st.size() > 2 )
    cout<<"NO";
else
{
    cout<<"YES\n";
     if ( n== 1)
    cout<<x <<" "<<x;
    else
cout<<*st.rbegin()<<" "<<*st.rbegin();
}
}


#include <bits/stdc++.h>
#define SIZE 1000007
#define MOD 1000000007
#define pi 3.14159265359
using namespace std;

vector<int> pri;
void sieve(){
    bool f[SIZE];
    f[0] = f[1] = 1;
    for(int i=2; i<SIZE; ++i){ if( f[i] ) continue;
        pri.push_back(i);
    for(int j = i*i; i<=10000 && j<SIZE; j += i) f[j] = 1;}}

bool prime(int x) {
if ( x==2)  return true;
if ( x<2 || x%2==0 )  return false;
	for (int i = 3; i *i <= x; i+=2) if (x%i == 0)  return false;  return true; }

vector<int> factor;
void GetFactor(int n){
    for(int i=2; i<=n/i; ++i){
        while( n % i == 0 ){
            factor.push_back(i);
            n /= i;
        }
    }if(n!=1)factor.push_back(n);
}

long long MaxSubarray(long long arr[], int n){
    long long best = -1e18, sum = 0;
    for(int i=0; i<n; ++i){
        sum = max( arr[i], arr[i] + sum );
        best = max( best, sum );
    } return best;
}

long long GCD(long long a, long long b){
    return b ? GCD(b, a%b) : a ;
}
long long LCM(long long a, long long b){
    return a / GCD(a, b) * b;
}

long long fast_power(long long b, long long p){
    long long res=1;
    while(p){
        if(p%2) res = ( res * b ) % MOD;
        b = ( b * b ) % MOD;
        p /= 2;
    }
    return res;
}
bool isvalid ( int r , int c , int R , int C)
{
    return ( r >= 0 && r < R && c >= 0 && c < C);
}
int dx[]= {-1, 1, 0, 0};
int dy[]= {0, 0, 1, -1};
#define ll long long
#define ull unsigned long long
#define lld long long double
#define sz(v)   ((int)((v).size()))
#define sortv(v) sort(v.begin(),v.end());
#define all(v) ((v).begin()), ((v).end())
#define rev(x) reverse(x.begin(),x.end())

#define fr(c,x,n)  for(int c=x;c<n;++c)
#define fz(c,n)  for(int c=0;c< n ;++c)
#define fo(c,n) for(int c = 1; c < n; ++c)
#define fn(c,n) for (int c = n; c>=0; ++c)
#define MNX ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

int main()
{
ll n , a  , x , f = 1 ;
set < long long  > st;

cin>>n;
fz ( i,n )
{
    cin>>x;
    if (i==0)
        a = x ;
    else
    {
         if ( abs ( a-x) == 0  )
            f = 0 ;

        if ( f!= 0 )
        {
        st.insert(abs(a-x));
        a = x ;
        }
    }
}
if ( n== 1)
{

    cout<<"YES\n"<<1000000000<<" "<<1000000000;
}
else if ( f == 0 || st.size() > 2  )
{
    cout<<"NO";
}
else if ( st.size() == 1 )
{
    cout<<"YES\n"<<1000000000<<" "<<*st.begin();
}
else
{
    if (*st.begin() == 1)
    cout<<"YES\n"<<1000000000<<" "<<*st.rbegin();
    else
    cout<<"NO";

}}


#include <bits/stdc++.h>
#define SIZE 1000007
#define MOD 1000000007
#define pi 3.14159265359
using namespace std;

vector<int> pri;
void sieve(){
    bool f[SIZE];
    f[0] = f[1] = 1;
    for(int i=2; i<SIZE; ++i){ if( f[i] ) continue;
        pri.push_back(i);
    for(int j = i*i; i<=10000 && j<SIZE; j += i) f[j] = 1;}}

bool prime(int x) {
if ( x==2)  return true;
if ( x<2 || x%2==0 )  return false;
	for (int i = 3; i *i <= x; i+=2) if (x%i == 0)  return false;  return true; }

vector<int> factor;
void GetFactor(int n){
    for(int i=2; i<=n/i; ++i){
        while( n % i == 0 ){
            factor.push_back(i);
            n /= i;
        }
    }if(n!=1)factor.push_back(n);
}

long long MaxSubarray(long long arr[], int n){
    long long best = -1e18, sum = 0;
    for(int i=0; i<n; ++i){
        sum = max( arr[i], arr[i] + sum );
        best = max( best, sum );
    } return best;
}

long long GCD(long long a, long long b){
    return b ? GCD(b, a%b) : a ;
}
long long LCM(long long a, long long b){
    return a / GCD(a, b) * b;
}

long long fast_power(long long b, long long p){
    long long res=1;
    while(p){
        if(p%2) res = ( res * b ) % MOD;
        b = ( b * b ) % MOD;
        p /= 2;
    }
    return res;
}
bool isvalid ( int r , int c , int R , int C)
{
    return ( r >= 0 && r < R && c >= 0 && c < C);
}
int dx[]= {-1, 1, 0, 0};
int dy[]= {0, 0, 1, -1};
#define ll long long
#define ull unsigned long long
#define lld long long double
#define sz(v)   ((int)((v).size()))
#define sortv(v) sort(v.begin(),v.end());
#define all(v) ((v).begin()), ((v).end())
#define rev(x) reverse(x.begin(),x.end())

#define fr(c,x,n)  for(int c=x;c<n;++c)
#define fz(c,n)  for(int c=0;c< n ;++c)
#define fo(c,n) for(int c = 1; c < n; ++c)
#define fn(c,n) for (int c = n; c>=0; ++c)
#define MNX ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

set < long long  > st;

int main()
{
ll n , a  , x , f = 1 ;
cin>>n;
fz ( i,n )
{
    cin>>x;
    if (!i)
    {
        a = x ;
    }
    else
    {
         if ( abs ( a-x) == 0  )
            f = 0 ;

        if ( f )
        {
        st.insert(abs(a-x));
        a = x ;
        }
    }
}
if ( f== 0 || st.size() > 2 )
    cout<<"NO";
else if ( st.size() == 2)
{
    if ( *st.begin() != 1 )
        cout<<"NO";
    else
    {
        cout<<"YES\n";
        cout<<1000000000<<" "<<*st.rbegin();
    }

}
else
{
    cout<<"YES\n";
     if ( n== 1)
cout<<1000000000<<" "<<1000000000;
    else
cout<<1000000000<<" "<<*st.begin();
}
}


#include <bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define ll long long
#define ld long double
#define vi   vector<int>
#define pii pair<int, int>
#define ull unsigned long long
#define sz(v)  ((int)((v).size()))
#define all(v) ((v).begin()),((v).end())
#define MEM(dp,i) memset(dp ,i, sizeof (dp))
#define repit( cont , i  ) for( auto i : cont)
#define forr(c,x,n)   for(ll c=x;c<=(ll)n; ++c )
#define forrr(c,x,n)  for(ll c=x;c>=( ll )n ;--c )
#define db(x) cout << " LOOK " <<(#x) <<" = " <<  x << '\n'
#define ICPC ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define printarr(a , l , r ) forr ( i , l , r )cout << a[i] << " ";cout<<endl;
#define printarr2(a, n , m) forr ( i , 1 , n){forr ( j , 1, m )cout << a[i][j] << " ";cout<<endl;}

//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);

int main()
{
ICPC;
int n ;
cin >> n ;
int a[200007];
set <int  > st;
int f=  1;
for ( int i = 0 ; i < n ; i ++ )
{
    cin >> a[i];
    a[i]--;
    if ( i )
        {
            if ( abs(a[i] - a[i-1]) == 1 )
                continue;
           else  if ( abs(a[i] - a[i-1]) == 0)
                 f = 0  ;
               else
            st.insert( abs(a[i] - a[i-1]) );
        }
}

if ( !st.size() && f  )
    cout <<"YES\n"  <<(int)1e9 << " " <<(int) 1e9 ;
else if ( st.size() == 1  && f )
{
int k = *st.begin() ;
for ( int i = 1 ; i <n  ;i++ )
    if ( abs( a[i] - a[i-1] ) == 1 && a[i] /k != a[i-1] /k  )
        return cout << "NO" , 0 ;

  cout << "YES\n" << (int)1e9 << " " << k << endl;
}
else
 cout << "NO" << endl;

}


#include <bits/stdc++.h>
#define SIZE 1000007
#define MOD 1000000007
#define pi 3.14159265359
using namespace std;

vector<int> pri;
void sieve(){
    bool f[SIZE];
    f[0] = f[1] = 1;
    for(int i=2; i<SIZE; ++i){ if( f[i] ) continue;
        pri.push_back(i);
    for(int j = i*i; i<=10000 && j<SIZE; j += i) f[j] = 1;}}

bool prime(int x) {
if ( x==2)  return true;
if ( x<2 || x%2==0 )  return false;
	for (int i = 3; i *i <= x; i+=2) if (x%i == 0)  return false;  return true; }

vector<int> factor;
void GetFactor(int n){
    for(int i=2; i<=n/i; ++i){
        while( n % i == 0 ){
            factor.push_back(i);
            n /= i;
        }
    }if(n!=1)factor.push_back(n);
}

long long MaxSubarray(long long arr[], int n){
    long long best = -1e18, sum = 0;
    for(int i=0; i<n; ++i){
        sum = max( arr[i], arr[i] + sum );
        best = max( best, sum );
    } return best;
}

long long GCD(long long a, long long b){
    return b ? GCD(b, a%b) : a ;
}
long long LCM(long long a, long long b){
    return a / GCD(a, b) * b;
}

long long fast_power(long long b, long long p){
    long long res=1;
    while(p){
        if(p%2) res = ( res * b ) % MOD;
        b = ( b * b ) % MOD;
        p /= 2;
    }
    return res;
}
bool isvalid ( int r , int c , int R , int C)
{
    return ( r >= 0 && r < R && c >= 0 && c < C);
}
int dx[]= {-1, 1, 0, 0};
int dy[]= {0, 0, 1, -1};
#define ll long long
#define ull unsigned long long
#define lld long long double
#define sz(v)   ((int)((v).size()))
#define sortv(v) sort(v.begin(),v.end());
#define all(v) ((v).begin()), ((v).end())
#define rev(x) reverse(x.begin(),x.end())

#define fr(c,x,n)  for(int c=x;c<n;++c)
#define fz(c,n)  for(int c=0;c< n ;++c)
#define fo(c,n) for(int c = 1; c < n; ++c)
#define fn(c,n) for (int c = n; c>=0; ++c)
#define MNX ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

set < long long  > st;

int main()
{
ll n , a  , x , f = 1 ;
cin>>n;
fz ( i,n )
{
    cin>>x;
    if (!i)
    {
        a = x ;
    }
    else
    {
         if ( abs ( a-x) == 0 )
            {f = 0 ; break; }
        st.insert(abs(a-x));
        a = x ;

    }
}
if ( f== 0 || st.size() > 2 )
    cout<<"NO";
else if ( st.size() == 2)
{
    if ( *st.begin() != 1 )
        cout<<"NO";
    else
    {
        cout<<"YES\n";
        cout<<1000000000<<" "<<*st.rbegin();
    }

}
else
{
    cout<<"YES\n";
     if ( n== 1)
cout<<1000000000<<" "<<1000000000;
    else
cout<<1000000000<<" "<<*st.rbegin();
}
}


#include <bits/stdc++.h>
#define SIZE 1000007
#define MOD 1000000007
#define pi 3.14159265359
using namespace std;

vector<int> pri;
void sieve(){
    bool f[SIZE];
    f[0] = f[1] = 1;
    for(int i=2; i<SIZE; ++i){ if( f[i] ) continue;
        pri.push_back(i);
    for(int j = i*i; i<=10000 && j<SIZE; j += i) f[j] = 1;}}

bool prime(int x) {
if ( x==2)  return true;
if ( x<2 || x%2==0 )  return false;
	for (int i = 3; i *i <= x; i+=2) if (x%i == 0)  return false;  return true; }

vector<int> factor;
void GetFactor(int n){
    for(int i=2; i<=n/i; ++i){
        while( n % i == 0 ){
            factor.push_back(i);
            n /= i;
        }
    }if(n!=1)factor.push_back(n);
}

long long MaxSubarray(long long arr[], int n){
    long long best = -1e18, sum = 0;
    for(int i=0; i<n; ++i){
        sum = max( arr[i], arr[i] + sum );
        best = max( best, sum );
    } return best;
}

long long GCD(long long a, long long b){
    return b ? GCD(b, a%b) : a ;
}
long long LCM(long long a, long long b){
    return a / GCD(a, b) * b;
}

long long fast_power(long long b, long long p){
    long long res=1;
    while(p){
        if(p%2) res = ( res * b ) % MOD;
        b = ( b * b ) % MOD;
        p /= 2;
    }
    return res;
}
bool isvalid ( int r , int c , int R , int C)
{
    return ( r >= 0 && r < R && c >= 0 && c < C);
}
int dx[]= {-1, 1, 0, 0};
int dy[]= {0, 0, 1, -1};
#define ll long long
#define ull unsigned long long
#define lld long long double
#define sz(v)   ((int)((v).size()))
#define sortv(v) sort(v.begin(),v.end());
#define all(v) ((v).begin()), ((v).end())
#define rev(x) reverse(x.begin(),x.end())

#define fr(c,x,n)  for(int c=x;c<n;++c)
#define fz(c,n)  for(int c=0;c< n ;++c)
#define fo(c,n) for(int c = 1; c < n; ++c)
#define fn(c,n) for (int c = n; c>=0; ++c)
#define MNX ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

set < long long  > st;

int main()
{
ll n , a  , x , f = 1 ;
cin>>n;
fz ( i,n )
{
    cin>>x;
    if (!i)
    {
        a = x ;
    }
    else
    {
         if ( abs ( a-x) == 0 )
            {f = 0 ; break; }
        st.insert(abs(a-x));
        a = x ;

    }
}
if ( f== 0 || st.size() > 2 )
    cout<<"NO";
else
{cout<<"YES\n";
cout<<*st.rbegin()<<" "<<*st.rbegin();
}
}