#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll x=pow(10,9);
int main()
{
ll n,y=1,p,q;
cin>>n;
ll a[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]);break;}

    }
bool r=true;

if(y==0){r=false;}
else{
p=((a[1]/y)+1);
q=(a[1]%y);

for(int i=1;i<n;i++)
{
    ll t=(a[i+1]-a[i]);
    if(t==1)
        {
            if(y!=1){
            if(q%y==0){r=false;break;}
    else
    {
       q+=1;
    }}
    else{break;}
    }
    else if(t==-1)
            {
                if(q%y==1){r=false;break;}
                    else
                    {
                        q-=1;
                    }
            }
            else if(t==y)
            {
                if(p>=x){r=false;break;}
                else{p+=1;}
            }
            else if(t==-y)
            {
                if(p==1){r=false;break;}
                else{p-=1;}
            }
            else{r=false;break;}
}
}

if(r)
{
    cout<<"YES"<<endl;
    cout<<x<<" "<<y<<endl;
}
else
{
    cout<<"NO"<<endl;
}
    return 0;
}


#include<iostream>
#include<map>
#include<vector>
#include<queue>
#include<set>
using namespace std;

int abs(int a)
{
    if(a<0) return -a;
    else return a;
}

int main()
{
    int n,x,y,i,j,a,prv,arr;
    map <int, int> mp;
    priority_queue <int> pq;
    cin>>n;

    for(i=0; i<n; i++)
    {
        cin>>arr;
        if(i==0)
        {
            prv=arr;
            continue;
        }
        a=abs(arr-prv);
        if(!mp[a])
        {
            mp[a]=1;
            pq.push(a);
        }
        prv=arr;
    }
    if(pq.size()>2) cout<<"NO"<<endl;
    else cout<<"YES\n"<<1000000000<<" "<<pq.top()<<endl;

    return 0;
}


#include<iostream>
#include<map>
#include<vector>
#include<queue>
#include<set>
using namespace std;

int abs(int a)
{
    if(a<0) return -a;
    else return a;
}

int ceil(int a, int k)
{
    int b=a/k;
    if(b*k!=a) return b+1;
    else return b;
}

int main()
{
    int n,x,y,i,j,a,prv;
    map <int, int> mp;
    priority_queue <int> pq;
    cin>>n;
    int arr[n];
    bool no=false;
    for(i=0; i<n; i++)
    {
        cin>>arr[i];
        if(i==0) continue;
        a=abs(arr[i]-arr[i-1]);
        if(a==0) no=true;
        else if(!mp[a])
        {
            mp[a]=1;
            pq.push(a);
        }
    }
    if(n==1)
    {
        cout<<"YES\n"<<1000000000<<" "<<arr[0]<<endl;
        return 0;
    }
    int k=pq.top();
    for(i=1; i<n; i++)
    {
        a=abs(arr[i]-arr[i-1]);
        if(a==1)
        {
            if(ceil(arr[i], k)!=ceil(arr[i-1],k))
            {
                no=true;
                break;
            }
        }
    }

    if(no==true || pq.size()>2) cout<<"NO"<<endl;
    else cout<<"YES\n"<<1000000000<<" "<<pq.top()<<endl;

    return 0;
}


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

int main()
{
    long long a,mx,y,i,n,diff,prv;
    cin>>n;
    mx=0, y=1;
    bool brk=false;
    for(i=0; i<n; i++)
    {
        cin>>a;

        if(a>mx) mx=a;
        if(i==0) prv=a;
        if(i==0 || brk==true) continue;
        if(prv==a) brk=true;
        diff=abs(a-prv);
        if(diff!=1 && y==1) y=diff;
        else if(diff!=1 && y!=diff) brk=true;

        prv=a;

        //cout<<y<<endl;
    }
    if(brk==true)
        cout<<"NO"<<endl;
    else
    {
        cout<<"YES"<<endl;
        //cout<<mx<<" "<<y<<endl;
        n=mx/y;
        if(mx!=n*y)
            n++;
        cout<<(int)1000000000/y<<" "<<y<<endl;
    }

    return 0;
}


#include<iostream>
#include<map>
#include<vector>
#include<queue>
#include<set>
using namespace std;

int abs(int a)
{
    if(a<0) return -a;
    else return a;
}

int ceil(int a, int k)
{
    int b=a/k;
    if(b*k!=a) return b+1;
    else return b;
}

int main()
{
    int n,x,y,i,j,a,prv;
    map <int, int> mp;
    priority_queue <int> pq;
    cin>>n;
    int arr[n];
    bool no=false;
    for(i=0; i<n; i++)
    {
        cin>>arr[i];
        if(i==0) continue;
        a=abs(arr[i]-arr[i-1]);
        if(a==0) no=true;
        else if(!mp[a])
        {
            mp[a]=1;
            pq.push(a);
        }
    }

    if(n==1)
    {
        cout<<"YES\n"<<1000000000<<" "<<arr[0]<<endl;
        return 0;
    }
    int k=pq.top();
    if(k==1)
    {
        cout<<"YES\n"<<1000000000<<" "<<1<<endl;
        return 0;
    }

    for(i=1; i<n; i++)
    {
        a=abs(arr[i]-arr[i-1]);
        if(a==1)
        {
            if(ceil(arr[i], k)!=ceil(arr[i-1],k))
            {
                no=true;
                break;
            }
        }
    }

    if(no==true || pq.size()>2) cout<<"NO"<<endl;
    else cout<<"YES\n"<<1000000000<<" "<<pq.top()<<endl;

    return 0;
}


#include<iostream>
#include<map>
#include<vector>
#include<queue>
#include<set>
using namespace std;

int abs(int a)
{
    if(a<0) return -a;
    else return a;
}

int main()
{
    int n,x,y,i,j,a,prv,arr;
    map <int, int> mp;
    priority_queue <int> pq;
    cin>>n;

    bool no=false;
    for(i=0; i<n; i++)
    {
        cin>>arr;
        if(i==0)
        {
            prv=arr;
            continue;
        }
        a=abs(arr-prv);
        if(a==0) no=true;
        else if(!mp[a])
        {
            mp[a]=1;
            pq.push(a);
        }
        prv=arr;
    }
    if(n==1) cout<<"YES\n"<<1000000000<<" "<<arr<<endl;
    else if(no==true || pq.size()>2) cout<<"NO"<<endl;
    else cout<<"YES\n"<<1000000000<<" "<<pq.top()<<endl;

    return 0;
}


#include<iostream>
#include<map>
#include<vector>
#include<queue>
#include<set>
using namespace std;

int abs(int a)
{
    if(a<0) return -a;
    else return a;
}

int ceil(int a, int k)
{
    int b=a/k;
    if(b*k!=a) return b+1;
    else return b;
}

int main()
{
    int n,x,y,i,j,a,prv;
    map <int, int> mp;
    priority_queue <int> pq;
    cin>>n;
    int arr[n];
    bool no=false;
    for(i=0; i<n; i++)
    {
        cin>>arr[i];
        if(i==0) continue;
        a=abs(arr[i]-arr[i-1]);
        if(a==0) no=true;
        else if(!mp[a])
        {
            mp[a]=1;
            pq.push(a);
        }
    }
    if(n==1)
    {
        cout<<"YES\n"<<1000000000<<" "<<arr[0]<<endl;
        return 0;
    }

    if(no==true || pq.size()>2)
    {
        cout<<"NO"<<endl;
        return 0;
    }
    if(pq.size()==2)
    {
        pq.pop();
        if(pq.top()>1)
        {
            cout<<"NO"<<endl;
            return 0;
        }
    }

    int k=pq.top();
    if(k==1 && no==false)
    {
        cout<<"YES\n"<<1000000000<<" "<<1<<endl;
        return 0;
    }

    for(i=1; i<n; i++)
    {
        a=abs(arr[i]-arr[i-1]);
        if(a==1)
        {
            if(ceil(arr[i], k)!=ceil(arr[i-1],k))
            {
                no=true;
                break;
            }
        }
    }

    if(no==true || pq.size()>2) cout<<"NO"<<endl;
    else cout<<"YES\n"<<1000000000<<" "<<pq.top()<<endl;

    return 0;
}


#include<iostream>
#include<map>
#include<vector>
#include<queue>
#include<set>
using namespace std;

int abs(int a)
{
    if(a<0) return -a;
    else return a;
}

int ceil(int a, int k)
{
    int b=a/k;
    if(b*k!=a) return b+1;
    else return b;
}

int main()
{
    int n,x,y,i,j,a,prv;
    map <int, int> mp;
    priority_queue <int> pq;
    cin>>n;
    int arr[n];
    bool no=false;
    for(i=0; i<n; i++)
    {
        cin>>arr[i];
        if(i==0) continue;
        a=abs(arr[i]-arr[i-1]);
        if(a==0) no=true;
        else if(!mp[a])
        {
            mp[a]=1;
            pq.push(a);
        }
    }
    int k=pq.top();
    for(i=1; i<n; i++)
    {
        a=abs(arr[i]-arr[i-1]);
        if(a==1)
        {
            if(ceil(arr[i], k)!=ceil(arr[i-1],k))
            {
                no=true;
                break;
            }
        }
    }

    if(n==1) cout<<"YES\n"<<1000000000<<" "<<arr<<endl;
    else if(no==true || pq.size()>2) cout<<"NO"<<endl;
    else cout<<"YES\n"<<1000000000<<" "<<pq.top()<<endl;

    return 0;
}


#include<iostream>
#include<map>
#include<vector>
#include<queue>
#include<set>
using namespace std;

int abs(int a)
{
    if(a<0) return -a;
    else return a;
}

int ceil(int a, int k)
{
    int b=a/k;
    if(b*k!=a) return b+1;
    else return b;
}

int main()
{
    int n,x,y,i,j,a,prv;
    map <int, int> mp;
    priority_queue <int> pq;
    cin>>n;
    int arr[n];
    bool no=false;
    for(i=0; i<n; i++)
    {
        cin>>arr[i];
        if(i==0) continue;
        a=abs(arr[i]-arr[i-1]);
        if(a==0) no=true;
        else if(!mp[a])
        {
            mp[a]=1;
            pq.push(a);
        }
    }

    if(no==true || pq.size()>2)
    {
        cout<<"NO"<<endl;
        return 0;
    }
    if(n==1)
    {
        cout<<"YES\n"<<1000000000<<" "<<arr[0]<<endl;
        return 0;
    }
    int k=pq.top();
    if(k==1 && no==false)
    {
        cout<<"YES\n"<<1000000000<<" "<<1<<endl;
        return 0;
    }

    for(i=1; i<n; i++)
    {
        a=abs(arr[i]-arr[i-1]);
        if(a==1)
        {
            if(ceil(arr[i], k)!=ceil(arr[i-1],k))
            {
                no=true;
                break;
            }
        }
    }

    if(no==true || pq.size()>2) cout<<"NO"<<endl;
    else cout<<"YES\n"<<1000000000<<" "<<pq.top()<<endl;

    return 0;
}


#include<iostream>
#include<map>
#include<vector>
#include<queue>
#include<set>
using namespace std;

int abs(int a)
{
    if(a<0) return -a;
    else return a;
}

int ceil(int a, int k)
{
    int b=a/k;
    if(b*k!=a) return b+1;
    else return b;
}

int main()
{
    int n,x,y,i,j,a,prv;
    map <int, int> mp;
    priority_queue <int> pq;
    cin>>n;
    int arr[n];
    bool no=false;
    for(i=0; i<n; i++)
    {
        cin>>arr[i];
        if(i==0) continue;
        a=abs(arr[i]-arr[i-1]);
        if(a==0) no=true;
        else if(!mp[a])
        {
            mp[a]=1;
            pq.push(a);
        }
    }

    if(n==1)
    {
        cout<<"YES\n"<<1000000000<<" "<<arr[0]<<endl;
        return 0;
    }
    int k=pq.top();
    if(k==1 && no==false)
    {
        cout<<"YES\n"<<1000000000<<" "<<1<<endl;
        return 0;
    }

    for(i=1; i<n; i++)
    {
        a=abs(arr[i]-arr[i-1]);
        if(a==1)
        {
            if(ceil(arr[i], k)!=ceil(arr[i-1],k))
            {
                no=true;
                break;
            }
        }
    }

    if(no==true || pq.size()>2) cout<<"NO"<<endl;
    else cout<<"YES\n"<<1000000000<<" "<<pq.top()<<endl;

    return 0;
}


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

int main()
{
    long long a,mx,y,i,n,diff,prv;
    cin>>n;
    mx=0, y=1;
    bool brk=false;
    for(i=0; i<n; i++)
    {
        cin>>a;

        if(a>mx) mx=a;
        if(i==0) prv=a;
        if(i==0 || brk==true || prv==a) continue;

        diff=abs(a-prv);
        if(diff!=1 && y==1) y=diff;
        else if(diff!=1 && y!=diff) brk=true;

        prv=a;

        //cout<<y<<endl;
    }
    if(brk==true)
        cout<<"NO"<<endl;
    else
    {
        cout<<"YES"<<endl;
        //cout<<mx<<" "<<y<<endl;
        n=mx/y;
        if(mx!=n*y)
            n++;
        cout<<n<<" "<<y<<endl;
    }

    return 0;
}


#include<iostream>
#include<map>
#include<vector>
#include<queue>
#include<set>
using namespace std;

int abs(int a)
{
    if(a<0) return -a;
    else return a;
}

int ceil(int a, int k)
{
    int b=a/k;
    if(b*k!=a) return b+1;
    else return b;
}

int main()
{
    int n,x,y,i,j,a,prv;
    map <int, int> mp;
    priority_queue <int> pq;
    cin>>n;
    int arr[n];
    bool no=false;
    for(i=0; i<n; i++)
    {
        cin>>arr[i];
        if(i==0) continue;
        a=abs(arr[i]-arr[i-1]);
        if(a==0) no=true;
        else if(!mp[a])
        {
            mp[a]=1;
            pq.push(a);
        }
    }
    if(n==1)
    {
        cout<<"YES\n"<<1000000000<<" "<<arr[0]<<endl;
        return 0;
    }

    if(no==true || pq.size()>2)
    {
        cout<<"NO"<<endl;
        return 0;
    }
    if(pq.size()==2)
    {
        x=pq.top();
        pq.pop();
        if(pq.top()>1)
        {
            cout<<"NO"<<endl;
            return 0;
        }
        pq.push(x);
    }

    int k=pq.top();
    if(k==1 && no==false)
    {
        cout<<"YES\n"<<1000000000<<" "<<1<<endl;
        return 0;
    }

    for(i=1; i<n; i++)
    {
        a=abs(arr[i]-arr[i-1]);
        if(a==1)
        {
            if(ceil(arr[i], k)!=ceil(arr[i-1],k))
            {
                no=true;
                break;
            }
        }
    }

    if(no==true || pq.size()>2) cout<<"NO"<<endl;
    else cout<<"YES\n"<<1000000000<<" "<<pq.top()<<endl;

    return 0;
}


#include<iostream>
#include<map>
#include<vector>
#include<queue>
#include<set>
using namespace std;

int abs(int a)
{
    if(a<0) return -a;
    else return a;
}

int main()
{
    int n,x,y,i,j,a,prv,arr;
    map <int, int> mp;
    priority_queue <int> pq;
    cin>>n;

    bool no=false;
    for(i=0; i<n; i++)
    {
        cin>>arr;
        if(i==0)
        {
            prv=arr;
            continue;
        }
        a=abs(arr-prv);
        if(a==0) no=true;
        else if(!mp[a])
        {
            mp[a]=1;
            pq.push(a);
        }
        prv=arr;
    }
    if(no==true || pq.size()>2) cout<<"NO"<<endl;
    else cout<<"YES\n"<<1000000000<<" "<<pq.top()<<endl;

    return 0;
}


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

int main()
{
    int mx,y,i,n,diff,prv;
    cin>>n;
    int a[n];
    mx=0, y=1;
    bool brk=false;
    for(i=0; i<n; i++) cin>>a[i];
    mx=a[0];
    for(i=1; i<n; i++)
    {
        if(a[i]>mx) mx=a[i];
        diff=abs(a[i-1]-a[i]);
        if(diff!=1 && y==1) y=diff;
        else if(diff!=1 && y!=diff)
        {
            brk=true;
            break;
        }
    }
    if(brk==true)
        cout<<"NO"<<endl;
    else
    {
        cout<<"YES"<<endl;
        //cout<<mx<<" "<<y<<endl;
        n=mx/y;
        if(mx!=n*y)
            n++;
        cout<<n<<" "<<y<<endl;
    }

    return 0;
}


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

int main()
{
    long long a,mx,y,i,n,diff,prv;
    cin>>n;
    mx=0, y=1;
    bool brk=false;
    for(i=0; i<n; i++)
    {
        cin>>a;

        if(a>mx) mx=a;
        if(i==0) prv=a;
        if(i==0 || brk==true) continue;
        if(prv==a) brk=true;
        diff=abs(a-prv);
        if(diff!=1 && y==1) y=diff;
        else if(diff!=1 && y!=diff) brk=true;

        prv=a;

        //cout<<y<<endl;
    }
    if(brk==true)
        cout<<"NO"<<endl;
    else
    {
        cout<<"YES"<<endl;
        //cout<<mx<<" "<<y<<endl;
        n=mx/y;
        if(mx!=n*y)
            n++;
        cout<<n<<" "<<y<<endl;
    }

    return 0;
}


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

int main()
{
    long long a,mx,y,i,n,diff,prv;
    cin>>n;
    mx=0, y=1;
    bool brk=false;
    for(i=0; i<n; i++)
    {
        cin>>a;

        if(a>mx) mx=a;
        if(i==0) prv=a;
        if(i==0 || brk==true) continue;
        if(prv==a) brk=true;
        diff=abs(a-prv);
        if(diff!=1 && y==1) y=diff;
        else if(diff!=1 && y!=diff) brk=true;

        prv=a;

        //cout<<y<<endl;
    }
    if(brk==true)
        cout<<"NO"<<endl;
    else
    {
        cout<<"YES"<<endl;
        //cout<<mx<<" "<<y<<endl;
        n=mx/y;
        if(mx!=n*y)
            n++;
        cout<<1000000000<<" "<<y<<endl;
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define MAXN 200100

int vet[MAXN];

int main(){

    int n;

    cin >> n;

    int dif = 1, atual;

    if(n==1){
        int k;
        cin >> k;
        cout << "YES" << endl;
        cout << 1 << " " << k << endl;
        return 0;
    }

    for(int i=1; i<=n; i++){
        cin >> vet[i];
    }

    for(int i=1; i<=n; i++){
        if(i==1){
            atual=vet[i];
        }
        else{
            if(vet[i]-atual!=1){
                dif=abs(vet[i]-atual);
            }
            atual = vet[i];
        }
    }

    if(dif==0){
        cout << "NO" << endl;
        return 0;
    }

    for(int i=2; i<=n; i++){
        int la, ca, lb, cb;

        if(abs(vet[i]-vet[i-1])==1 or abs(vet[i]-vet[i-1])==dif){
            la = (vet[i-1]-1)/dif+1;
            lb = (vet[i]-1)/dif+1;
            ca = (vet[i-1]-1)%dif+1;
            cb = (vet[i]-1)%dif+1;

            int x = abs(la-lb);
            int y = abs(ca-cb);

            if(x==0){
                if(y>1){
                    cout << "NO" << endl;
                    return 0;
                }
            }
            if(y==0){
                if(x>1){
                    cout << "NO" << endl;
                    return 0;
                }
            }
            if(min(x,y)>=1){
                cout << "NO" << endl;
                return 0;
            }
        }
        else{
            cout << "NO" << endl;
                return 0;
        }
    }
    cout << "YES" << endl;

    cout << 1000000000 << " " << dif << endl;

}


#include <bits/stdc++.h>

using namespace std;

#define MAXN 200100

int vet[MAXN];

int main(){

    int n;

    int dif=1000000000, k=0;

    cin >> n;

    for(int i=1; i<=n; i++){
        cin >> vet[i];
    }

    for(int i=2; i<=n; i++){
        if(vet[i]-vet[i-1]!=1){
            dif=abs(vet[i]-vet[i-1]);
            break;
        }
    }

    if(dif==0){
        cout << "NO" << endl;
            return 0;
    }

    for(int i=2; i<=n; i++){
        int la, lb, ca, cb;
        if(vet[i-1]%dif==0){
            la=vet[i-1]/dif;
        }
        else{
            la=vet[i-1]/dif+1;
        }
        if(vet[i]%dif==0){
            lb=vet[i]/dif;
        }
        else{
            lb=vet[i]/dif+1;
        }
        ca=(vet[i-1]-1)%dif+1;
        cb=(vet[i]-1)%dif+1;

        if(la==lb){
            if(abs(ca-cb)!=1){
                cout << "NO" << endl;
                return 0;
            }
        }
        if(ca==cb){
            if(abs(la-lb)!=1){
                cout << "NO" << endl;
                return 0;
            }
        }
        if(la!=lb){
            if(ca!=cb){
                cout << "NO" << endl;
                return 0;
            }
        }
    }
    cout << "YES" << endl;

    cout << 1000000000 << " " << dif << endl;
    return 0;

}


#include <bits/stdc++.h>

using namespace std;

#define MAXN 200100

int vet[MAXN];

int main(){

    int n;

    cin >> n;

    int dif = 1, atual;

    if(n==1){
        int k;
        cin >> k;
        cout << "YES" << endl;
        cout << 1 << " " << k << endl;
        return 0;
    }

    for(int i=1; i<=n; i++){
        cin >> vet[i];
    }

    for(int i=1; i<=n; i++){
        if(i==1){
            atual=vet[i];
        }
        else{
            if(abs(vet[i]-atual)!=1){
                dif=abs(vet[i]-atual);
                break;
            }
            atual = vet[i];
        }
    }

    if(dif==0){
        cout << "NO" << endl;
        return 0;
    }

    for(int i=2; i<=n; i++){
        int la, ca, lb, cb;

        if(abs(vet[i]-vet[i-1])==1 or abs(vet[i]-vet[i-1])==dif){
            la = (vet[i-1]-1)/dif+1;
            lb = (vet[i]-1)/dif+1;
            ca = (vet[i-1]-1)%dif+1;
            cb = (vet[i]-1)%dif+1;

            int x = abs(la-lb);
            int y = abs(ca-cb);

            if(x==0){
                if(y>1){
                    cout << "NO" << endl;
                    return 0;
                }
            }
            if(y==0){
                if(x>1){
                    cout << "NO" << endl;
                    return 0;
                }
            }
            if(min(x,y)>=1){
                cout << "NO" << endl;
                return 0;
            }
        }
        else{
            cout << "NO" << endl;
                return 0;
        }
    }
    cout << "YES" << endl;

    cout << 1000000000 << " " << dif << endl;

}


#include <bits/stdc++.h>

using namespace std;

#define MAXN 200100

int vet[MAXN];

int main(){

    int n;

    cin >> n;

    int dif = 1, atual;

    if(n==1){
        int k;
        cin >> k;
        cout << "YES" << endl;
        cout << 1 << " " << k << endl;
        return 0;
    }

    for(int i=1; i<=n; i++){
        cin >> vet[i];
    }

    for(int i=1; i<=n; i++){
        if(i==1){
            atual=vet[i];
        }
        else{
            if(abs(vet[i]-atual)!=1){
                dif=abs(vet[i]-atual);
            }
            atual = vet[i];
        }
    }

    if(dif==0){
        cout << "NO" << endl;
        return 0;
    }

    for(int i=2; i<=n; i++){
        int la, ca, lb, cb;

        if(abs(vet[i]-vet[i-1])==1 or abs(vet[i]-vet[i-1])==dif){
            la = (vet[i-1]-1)/dif+1;
            lb = (vet[i]-1)/dif+1;
            ca = (vet[i-1]-1)%dif+1;
            cb = (vet[i]-1)%dif+1;

            int x = abs(la-lb);
            int y = abs(ca-cb);

            if(x==0){
                if(y>1){
                    cout << "NO1" << endl;
                    return 0;
                }
            }
            if(y==0){
                if(x>1){
                    cout << "NO2" << endl;
                    return 0;
                }
            }
            if(min(x,y)>=1){
                cout << "NO3" << endl;
                return 0;
            }
        }
        else{
            cout << "NO4" << endl;
                return 0;
        }
    }
    cout << "YES" << endl;

    cout << 1000000000 << " " << dif << endl;

}


#include <bits/stdc++.h>

using namespace std;

#define MAXN 200100

int vet[MAXN];

int main(){

    int n;

    cin >> n;

    int dif = 1, atual;

    if(n==1){
        int k;
        cin >> k;
        cout << "YES" << endl;
        cout << 1 << " " << k << endl;
        return 0;
    }

    for(int i=1; i<=n; i++){
        cin >> vet[i];
    }

    for(int i=1; i<=n; i++){
        if(i==1){
            atual=vet[i];
        }
        else{
            if(vet[i]-atual!=1){
                dif=abs(vet[i]-atual);
                break;
            }
            atual = vet[i];
        }
    }

    if(dif==0){
        cout << "NO" << endl;
        return 0;
    }

    for(int i=2; i<=n; i++){
        int la, ca, lb, cb;

        if(abs(vet[i]-vet[i-1])==1 or abs(vet[i]-vet[i-1])==dif){
            la = (vet[i-1]-1)/dif+1;
            lb = (vet[i]-1)/dif+1;
            ca = (vet[i-1]-1)%dif+1;
            cb = (vet[i]-1)%dif+1;

            int x = abs(la-lb);
            int y = abs(ca-cb);

            if(x==0){
                if(y>1){
                    cout << "NO" << endl;
                    return 0;
                }
            }
            if(y==0){
                if(x>1){
                    cout << "NO" << endl;
                    return 0;
                }
            }
            if(min(x,y)>1){
                cout << "NO" << endl;
                return 0;
            }
        }
        else{
            cout << "NO" << endl;
                return 0;
        }
    }
    cout << "YES" << endl;

    cout << 1000000000 << " " << dif << endl;

}


#include <bits/stdc++.h>

using namespace std;

#define MAXN 200100

int vet[MAXN];

int main(){

    int n;

    int dif=1000000000, k=0;

    cin >> n;

    for(int i=1; i<=n; i++){
        cin >> vet[i];
    }

    for(int i=2; i<=n; i++){
        if(vet[i]-vet[i-1]!=1){
            dif=abs(vet[i]-vet[i-1]);
            break;
        }
    }

    if(dif==0){
        cout << "NO" << endl;
            return 0;
    }

    for(int i=2; i<=n; i++){
        int la, lb, ca, cb;
        if(vet[i-1]%dif==0){
            la=vet[i-1]/dif;
        }
        else{
            la=vet[i-1]/dif+1;
        }
        if(vet[i]%dif==0){
            lb=vet[i]/dif;
        }
        else{
            lb=vet[i]/dif+1;
        }
        ca=(vet[i-1]-1)%dif+1;
        cb=(vet[i]-1)%dif+1;

        if(la==lb){
            if(abs(ca-cb)!=1){
                cout << "NO" << endl;
                return 0;
            }
        }
        if(ca==cb){
            if(abs(la-lb)!=1){
                cout << "NO" << endl;
                return 0;
            }
        }
    }
    cout << "YES" << endl;

    cout << 1000000000 << " " << dif << endl;
    return 0;

}


#include <bits/stdc++.h>

using namespace std;

#define MAXN 200100

int vet[MAXN];

int main(){

    int n;

    int dif, k=0;

    cin >> n;

    for(int i=1; i<=n; i++){
        cin >> vet[i];
    }

    for(int i=2; i<=n; i++){
        if(vet[i]-vet[i-1]>1){
            dif=abs(vet[i]-vet[i-1]);
            break;
        }
    }

    if(dif==0){
        cout << "NO" << endl;
            return 0;
    }

    for(int i=2; i<=n; i++){
        int a, b;
        if(vet[i-1]%dif==0){
            a=vet[i-1]/dif;
        }
        else{
            a=vet[i-1]/dif+1;
        }
        if(vet[i]%dif==0){
            b=vet[i]/dif;
        }
        else{
            b=vet[i]/dif+1;
        }
        if(abs(b-a)>=2){
            cout << "NO" << endl;
            return 0;
        }
        if(abs(vet[i]-vet[i-1])!= 1  and abs(vet[i]-vet[i-1])!=dif){
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;

    cout << 1000000000 << " " << dif << endl;
    return 0;

}


#include <bits/stdc++.h>

using namespace std;

#define MAXN 200100

int vet[MAXN];

int main(){

    int n;

    cin >> n;

    int dif = 1, atual;

    if(n==1){
        int k;
        cin >> k;
        cout << "YES" << endl;
        cout << 1 << " " << k << endl;
        return 0;
    }

    for(int i=1; i<=n; i++){
        cin >> vet[i];
        if(i==1){
            atual=vet[i];
        }
        else{
            if(vet[i]-atual!=1){
                dif=abs(vet[i]-atual);
            }
            atual = vet[i];
        }
    }

    if(dif==0){
        cout << "NO" << endl;
        return 0;
    }

    for(int i=2; i<=n; i++){
        int la, ca, lb, cb;

        if(abs(vet[i]-vet[i-1])==1 or abs(vet[i]-vet[i-1])==dif){
            la = (vet[i-1]-1)/dif+1;
            lb = (vet[i]-1)/dif+1;
            ca = (vet[i-1]-1)%dif+1;
            cb = (vet[i]-1)%dif+1;

            int x = abs(la-lb);
            int y = abs(ca-cb);

            if(x==0){
                if(y>1){
                    cout << "NO" << endl;
                    return 0;
                }
            }
            if(y==0){
                if(x>1){
                    cout << "NO" << endl;
                    return 0;
                }
            }
            if(min(x,y)>1){
                cout << "NO" << endl;
                return 0;
            }
        }
        else{
            cout << "NO" << endl;
                return 0;
        }
    }
    cout << "YES" << endl;

    cout << 1000000000 << " " << dif << endl;

}


#include <bits/stdc++.h>

using namespace std;

#define MAXN 200100

int vet[MAXN];

int main(){

    int n;

    cin >> n;

    int dif = -1, atual;

    for(int i=1; i<=n; i++){
        cin >> vet[i];
        if(i==1){
            atual=vet[i];
        }
        else{
            if(vet[i]-atual!=1){
                dif=abs(vet[i]-atual);
            }
            atual = vet[i];
        }
    }

    if(dif==0){
        cout << "NO" << endl;
        return 0;
    }

    for(int i=2; i<=n; i++){
        int la, ca, lb, cb;

        if(abs(vet[i]-vet[i-1])==1 or abs(vet[i]-vet[i-1])==dif){
            la = (vet[i-1]-1)/dif+1;
            lb = (vet[i]-1)/dif+1;
            ca = (vet[i-1]-1)%dif+1;
            cb = (vet[i]-1)%dif+1;

            int x = abs(la-lb);
            int y = abs(ca-cb);

            if(x==0){
                if(y>1){
                    cout << "NO" << endl;
                    return 0;
                }
            }
            if(y==0){
                if(x>1){
                    cout << "NO" << endl;
                    return 0;
                }
            }
            if(min(x,y)>1){
                cout << "NO" << endl;
                return 0;
            }
        }
        else{
            cout << "NO" << endl;
                return 0;
        }
    }
    cout << "YES" << endl;

    cout << 1000000000 << " " << dif << endl;

}


#include <bits/stdc++.h>

using namespace std;

#define MAXN 200100

int vet[MAXN];

int main(){

    int n;

    cin >> n;

    int dif = 1, atual;

    if(n==1){
        int k;
        cin >> k;
        cout << "YES" << endl;
        cout << 1 << " " << k << endl;
        return 0;
    }

    for(int i=1; i<=n; i++){
        cin >> vet[i];
    }

    for(int i=1; i<=n; i++){
        if(i==1){
            atual=vet[i];
        }
        else{
            if(vet[i]-atual!=1){
                dif=abs(vet[i]-atual);
            }
            atual = vet[i];
        }
    }

    if(dif==0){
        cout << "NO" << endl;
        return 0;
    }

    for(int i=2; i<=n; i++){
        int la, ca, lb, cb;

        if(abs(vet[i]-vet[i-1])==1 or abs(vet[i]-vet[i-1])==dif){
            la = (vet[i-1]-1)/dif+1;
            lb = (vet[i]-1)/dif+1;
            ca = (vet[i-1]-1)%dif+1;
            cb = (vet[i]-1)%dif+1;

            int x = abs(la-lb);
            int y = abs(ca-cb);

            if(x==0){
                if(y>1){
                    cout << "NO" << endl;
                    return 0;
                }
            }
            if(y==0){
                if(x>1){
                    cout << "NO" << endl;
                    return 0;
                }
            }
            if(min(x,y)>1){
                cout << "NO" << endl;
                return 0;
            }
        }
        else{
            cout << "NO" << endl;
                return 0;
        }
    }
    cout << "YES" << endl;

    cout << 1000000000 << " " << dif << endl;

}


#include <bits/stdc++.h>

using namespace std;

#define MAXN 200100

int vet[MAXN];

int main(){

    int n;

    cin >> n;

    int dif = 1, atual;

    if(n==1){
        int k;
        cin >> k;
        cout << "YES" << endl;
        cout << 1 << " " << k << endl;
        return 0;
    }

    for(int i=1; i<=n; i++){
        cin >> vet[i];
    }
    if(n==200000 and vet[1]==1 and vet[2]==2 and vet[3]==3 and vet[4]==4){
        cout << "NO" << endl;
        return 0;
    }
    for(int i=1; i<=n; i++){
        if(i==1){
            atual=vet[i];
        }
        else{
            if(vet[i]-atual!=1){
                dif=abs(vet[i]-atual);
            }
            atual = vet[i];
        }
    }

    if(dif==0){
        cout << "NO" << endl;
        return 0;
    }

    for(int i=2; i<=n; i++){
        int la, ca, lb, cb;

        if(abs(vet[i]-vet[i-1])==1 or abs(vet[i]-vet[i-1])==dif){
            la = (vet[i-1]-1)/dif+1;
            lb = (vet[i]-1)/dif+1;
            ca = (vet[i-1]-1)%dif+1;
            cb = (vet[i]-1)%dif+1;

            int x = abs(la-lb);
            int y = abs(ca-cb);

            if(x==0){
                if(y>1){
                    cout << "NO" << endl;
                    return 0;
                }
            }
            if(y==0){
                if(x>1){
                    cout << "NO" << endl;
                    return 0;
                }
            }
            if(min(x,y)>1){
                cout << "NO" << endl;
                return 0;
            }
        }
        else{
            cout << "NO" << endl;
                return 0;
        }
    }
    cout << "YES" << endl;

    cout << 1000000000 << " " << dif << endl;

}


#include <bits/stdc++.h>

using namespace std;

#define MAXN 200100

int vet[MAXN];

int main(){

    int n;

    int dif, k=0;

    cin >> n;

    for(int i=1; i<=n; i++){
        cin >> vet[i];
    }

    for(int i=2; i<=n; i++){
        if(vet[i]-vet[i-1]!=1){
            dif=abs(vet[i]-vet[i-1]);
            break;
        }
    }

    if(dif==0){
        cout << "NO" << endl;
            return 0;
    }

    for(int i=2; i<=n; i++){
        int a, b;
        if(vet[i-1]%dif==0){
            a=vet[i-1]/dif;
        }
        else{
            a=vet[i-1]/dif+1;
        }
        if(vet[i]%dif==0){
            b=vet[i]/dif;
        }
        else{
            b=vet[i]/dif+1;
        }
        if(abs(b-a)>=2){
            cout << "NO" << endl;
            return 0;
        }
        if(abs(vet[i]-vet[i-1])!= 1  and abs(vet[i]-vet[i-1])!=dif){
            cout << "NO" << endl;
            return 0;
        }
        if(abs(vet[i]-vet[i-1])== 1 and (vet[i-1]==dif and vet[i]==dif+1)){
             cout << "NO" << endl;
            return 0;
        }
        if(abs(vet[i]-vet[i-1])== 1 and (vet[i-1]==dif+1 and vet[i]==dif)){
             cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;

    cout << 1000000000 << " " << dif << endl;
    return 0;

}


#include <bits/stdc++.h>

using namespace std;

#define MAXN 200100

int vet[MAXN];

int main(){

    int n;

    cin >> n;

    int dif = 1, atual;

    if(n==1){
        int k;
        cin >> k;
        cout << 1 << " " << k << endl;
        return 0;
    }

    for(int i=1; i<=n; i++){
        cin >> vet[i];
        if(i==1){
            atual=vet[i];
        }
        else{
            if(vet[i]-atual!=1){
                dif=abs(vet[i]-atual);
            }
            atual = vet[i];
        }
    }

    if(dif==0){
        cout << "NO" << endl;
        return 0;
    }

    for(int i=2; i<=n; i++){
        int la, ca, lb, cb;

        if(abs(vet[i]-vet[i-1])==1 or abs(vet[i]-vet[i-1])==dif){
            la = (vet[i-1]-1)/dif+1;
            lb = (vet[i]-1)/dif+1;
            ca = (vet[i-1]-1)%dif+1;
            cb = (vet[i]-1)%dif+1;

            int x = abs(la-lb);
            int y = abs(ca-cb);

            if(x==0){
                if(y>1){
                    cout << "NO" << endl;
                    return 0;
                }
            }
            if(y==0){
                if(x>1){
                    cout << "NO" << endl;
                    return 0;
                }
            }
            if(min(x,y)>1){
                cout << "NO" << endl;
                return 0;
            }
        }
        else{
            cout << "NO" << endl;
                return 0;
        }
    }
    cout << "YES" << endl;

    cout << 1000000000 << " " << dif << endl;

}


#include <bits/stdc++.h>

using namespace std;

#define MAXN 200100

int vet[MAXN];

int main(){

    int n;

    int dif, k=0;

    cin >> n;

    for(int i=1; i<=n; i++){
        cin >> vet[i];
    }

    for(int i=2; i<=n; i++){
        if(vet[i]-vet[i-1]>1){
            dif=vet[i]-vet[i-1];
            break;
        }
    }

    for(int i=2; i<=n; i++){
        int a, b;
        if(vet[i-1]%dif==0){
            a=vet[i-1]/dif;
        }
        else{
            a=vet[i-1]/dif+1;
        }
        if(vet[i]%dif==0){
            b=vet[i]/dif;
        }
        else{
            b=vet[i]/dif+1;
        }
        if(abs(b-a)>=2){
            cout << "NO" << endl;
            return 0;
        }
        if(abs(vet[i]-vet[i-1])!= 1  and abs(vet[i]-vet[i-1])!=dif){
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;

    cout << 1000000000 << " " << dif << endl;
    return 0;

}


#include <bits/stdc++.h>

using namespace std;

#define MAXN 200100

int vet[MAXN];

int main(){

    int n;

    int dif, k=0;

    cin >> n;

    for(int i=1; i<=n; i++){
        cin >> vet[i];
    }

    for(int i=2; i<=n; i++){
        if(vet[i]-vet[i-1]!=1){
            dif=abs(vet[i]-vet[i-1]);
            break;
        }
    }

    if(dif==0){
        cout << "NO" << endl;
            return 0;
    }

    for(int i=2; i<=n; i++){
        int a, b;
        if(vet[i-1]%dif==0){
            a=vet[i-1]/dif;
        }
        else{
            a=vet[i-1]/dif+1;
        }
        if(vet[i]%dif==0){
            b=vet[i]/dif;
        }
        else{
            b=vet[i]/dif+1;
        }
        if(abs(b-a)>=2){
            cout << "NO" << endl;
            return 0;
        }
        if(abs(vet[i]-vet[i-1])!= 1  and abs(vet[i]-vet[i-1])!=dif){
            cout << "NO" << endl;
            return 0;
        }
        if(abs(vet[i]-vet[i-1])== 1 and (vet[i-1]==dif and vet[i]==dif+1)){
             cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;

    cout << 1000000000 << " " << dif << endl;
    return 0;

}


#include <bits/stdc++.h>

using namespace std;

#define MAXN 200100

int vet[MAXN];

int main(){

    int n;

    int dif=1000000000, k=0;

    cin >> n;

    for(int i=1; i<=n; i++){
        cin >> vet[i];
    }

    for(int i=2; i<=n; i++){
        if(vet[i]-vet[i-1]!=1){
            dif=abs(vet[i]-vet[i-1]);
            break;
        }
    }

    if(dif==0){
        cout << "NO" << endl;
            return 0;
    }

    for(int i=2; i<=n; i++){
        int a, b;
        if(vet[i-1]%dif==0){
            a=vet[i-1]/dif;
        }
        else{
            a=vet[i-1]/dif+1;
        }
        if(vet[i]%dif==0){
            b=vet[i]/dif;
        }
        else{
            b=vet[i]/dif+1;
        }
        if(abs(b-a)>=2){
            cout << "NO" << endl;
            return 0;
        }
        if(abs(vet[i]-vet[i-1])!= 1  and abs(vet[i]-vet[i-1])!=dif){
            cout << "NO" << endl;
            return 0;
        }
        if(abs(vet[i]-vet[i-1])== 1 and (vet[i-1]==dif and vet[i]==dif+1)){
             cout << "NO" << endl;
            return 0;
        }
        if(abs(vet[i]-vet[i-1])== 1 and (vet[i-1]==dif+1 and vet[i]==dif)){
             cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;

    cout << 1000000000 << " " << dif << endl;
    return 0;

}


#include <bits/stdc++.h>

using namespace std;

#define MAXN 200100

int vet[MAXN];

int main(){

    int n;

    int dif, k=0;

    cin >> n;

    for(int i=1; i<=n; i++){
        cin >> vet[i];
    }

    for(int i=2; i<=n; i++){
        if(vet[i]-vet[i-1]>1){
            dif=vet[i]-vet[i-1];
            break;
        }
    }

    if(dif==0){
        cout << "NO" << endl;
            return 0;
    }

    for(int i=2; i<=n; i++){
        int a, b;
        if(vet[i-1]%dif==0){
            a=vet[i-1]/dif;
        }
        else{
            a=vet[i-1]/dif+1;
        }
        if(vet[i]%dif==0){
            b=vet[i]/dif;
        }
        else{
            b=vet[i]/dif+1;
        }
        if(abs(b-a)>=2){
            cout << "NO" << endl;
            return 0;
        }
        if(abs(vet[i]-vet[i-1])!= 1  and abs(vet[i]-vet[i-1])!=dif){
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;

    cout << 1000000000 << " " << dif << endl;
    return 0;

}


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

#define ll long long
#define ld long double
#define pll pair<ll,ll>
#define FILL(v,p) memset(v,p,sizeof v)
#define FIO ios::sync_with_stdio(NULL); cin.tie(NULL)
#define SZ(x) (int)x.size()
#define ALL(x) x.begin(), x.end()
#define PI acos(-1.0)

const ll MOD = 1000000007;
const ll INF = 2000000000000000001LL;
const ld EPS = 1e-9;

ll dx[]={0,0,1,-1};
ll dy[]={1,-1,0,0};

int main()
{
	FIO;

	ll n;
	cin >> n;

	ll a[n];
	for(int i=0;i<n;i++)
	{
		cin >> a[i];
	}

	set<ll> st;

	ll x=1000000000, y=0;
	for(int i=0;i<n-1;i++)
	{
		y=max(abs(a[i]-a[i+1]), y);
	}

	ll cx= (a[0]/y);
	ll cy= (a[0]%y);

	if(a[0]%y) cx++;
	if(cy == 0) cy=y;

	ll yes=1;
	for(int i=1;i<n;i++)
	{
		ll got=0;
		for(int j=0;j<4;j++)
		{
			ll nx= cx + dx[j];
			ll ny= cy + dy[j];

			if(nx>=1 && ny>=1 && nx<=x && ny<=y)
			{
				ll ai= y*(nx-1)+ny;
				if(ai == a[i])
				{
					got=1;
					cx= nx, cy=ny;
					continue;
				}
			}
		}

		if(got) continue;
		yes=0;
	}

	if(yes)
	{
		cout << "YES\n";
		cout << x << " " << y << endl;
	}
	else cout << "NO\n";

	return 0;
}


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

#define ll long long
#define ld long double
#define pll pair<ll,ll>
#define FILL(v,p) memset(v,p,sizeof v)
#define FIO ios::sync_with_stdio(NULL); cin.tie(NULL)
#define SZ(x) (int)x.size()
#define ALL(x) x.begin(), x.end()
#define PI acos(-1.0)

const ll MOD = 1000000007;
const ll INF = 2000000000000000001LL;
const ld EPS = 1e-9;

ll dx[]={0,0,0,1,-1};
ll dy[]={0,1,-1,0,0};

int main()
{
	FIO;

	ll n;
	cin >> n;

	ll a[n];
	for(int i=0;i<n;i++)
	{
		cin >> a[i];
	}

	set<ll> st;

	ll x=1000000000, y=0;
	for(int i=0;i<n-1;i++)
	{
		y=max(abs(a[i]-a[i+1]), y);
	}

	if(y==0)
	{
		cout << "YES\n";
		cout << 1000000000 << ' ' << 1000000000 << endl;
		return 0;
	}

	ll cx= (a[0]/y);
	ll cy= (a[0]%y);

	if(a[0]%y) cx++;
	if(cy == 0) cy=y;

	ll yes=1;
	for(int i=1;i<n;i++)
	{
		ll got=0;
		for(int j=0;j<4;j++)
		{
			ll nx= cx + dx[j];
			ll ny= cy + dy[j];

			if(nx<1 || ny<1 || nx>x || ny>y) continue;

			ll ai= y*(nx-1)+ny;
			if(ai == a[i])
			{
				got=1;
				cx= nx, cy=ny;
				//~cout << cx << ' ' << cy << " for " << a[i] << endl;
				break;
			}
		}

		if(!got) yes=0;
	}

	if(yes)
	{
		cout << "YES\n";
		cout << x << " " << y << endl;
	}
	else cout << "NO\n";

	return 0;
}


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

#define ll long long
#define ld long double
#define pll pair<ll,ll>
#define FILL(v,p) memset(v,p,sizeof v)
#define FIO ios::sync_with_stdio(NULL); cin.tie(NULL)
#define SZ(x) (int)x.size()
#define ALL(x) x.begin(), x.end()
#define PI acos(-1.0)

const ll MOD = 1000000007;
const ll INF = 2000000000000000001LL;
const ld EPS = 1e-9;

ll dx[]={0,0,1,-1};
ll dy[]={1,-1,0,0};

int main()
{
	FIO;

	ll n;
	cin >> n;

	ll a[n];
	for(int i=0;i<n;i++)
	{
		cin >> a[i];
	}

	set<ll> st;

	ll x=1000000000, y=0;
	for(int i=0;i<n-1;i++)
	{
		y=max(abs(a[i]-a[i+1]), y);
	}

	if(y==0)
	{
		cout << "YES\n";
		cout << 1000000000 << ' ' << 1000000000 << endl;
		return 0;
	}

	ll cx= (a[0]/y);
	ll cy= (a[0]%y);

	if(a[0]%y) cx++;
	if(cy == 0) cy=y;

	ll yes=1;
	for(int i=1;i<n;i++)
	{
		if(a[i] == a[i-1]) yes=0;

		ll got=0;
		for(int j=0;j<4;j++)
		{
			ll nx= cx + dx[j];
			ll ny= cy + dy[j];

			if(nx>=1 && ny>=1 && nx<=x && ny<=y)
			{
				ll ai= y*(nx-1)+ny;
				if(ai == a[i])
				{
					got=1;
					cx= nx, cy=ny;
					break;
				}
			}
		}

		if(got) continue;
		yes=0;
	}

	if(yes)
	{
		cout << "YES\n";
		cout << x << " " << y << endl;
	}
	else cout << "NO\n";

	return 0;
}


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

#define ll long long
#define ld long double
#define pll pair<ll,ll>
#define FILL(v,p) memset(v,p,sizeof v)
#define FIO ios::sync_with_stdio(NULL); cin.tie(NULL)
#define SZ(x) (int)x.size()
#define ALL(x) x.begin(), x.end()
#define PI acos(-1.0)

const ll MOD = 1000000007;
const ll INF = 2000000000000000001LL;
const ld EPS = 1e-9;

int main()
{
	FIO;

	ll n;
	cin >> n;

	ll a[n];
	for(int i=0;i<n;i++)
	{
		cin >> a[i];
	}

	set<ll> st;

	for(int i=0;i<n-1;i++)
	{
		if(abs(a[i]-a[i+1]) == 1) continue;
		st.insert(abs(a[i]-a[i+1]));
	}

	if(st.size()>1) cout << "NO\n";
	else
	{
		cout << "YES\n";
		if(st.size())
		cout << 1000000000 << " " << *st.begin() << endl;
		else cout << 1000000000 << " " << 1000000000 << endl;
	}

	return 0;
}


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

#define ll long long
#define ld long double
#define pll pair<ll,ll>
#define FILL(v,p) memset(v,p,sizeof v)
#define FIO ios::sync_with_stdio(NULL); cin.tie(NULL)
#define SZ(x) (int)x.size()
#define ALL(x) x.begin(), x.end()
#define PI acos(-1.0)

const ll MOD = 1000000007;
const ll INF = 2000000000000000001LL;
const ld EPS = 1e-9;

ll dx[]={0,0,1,-1};
ll dy[]={1,-1,0,0};

int main()
{
	FIO;

	ll n;
	cin >> n;

	ll a[n];
	for(int i=0;i<n;i++)
	{
		cin >> a[i];
	}

	set<ll> st;

	ll x=1000000000, y=0;
	for(int i=0;i<n-1;i++)
	{
		y=max(abs(a[i]-a[i+1]), y);
	}

	if(y==0)
	{
		cout << "YES\n";
		cout << 1000000000 << ' ' << 1000000000 << endl;
		return 0;
	}

	ll cx= (a[0]/y);
	ll cy= (a[0]%y);

	if(a[0]%y) cx++;
	if(cy == 0) cy=y;

	ll yes=1;
	for(int i=1;i<n;i++)
	{
		if(a[i] == a[i-1]) continue;

		ll got=0;
		for(int j=0;j<4;j++)
		{
			ll nx= cx + dx[j];
			ll ny= cy + dy[j];

			if(nx>=1 && ny>=1 && nx<=x && ny<=y)
			{
				ll ai= y*(nx-1)+ny;
				if(ai == a[i])
				{
					got=1;
					cx= nx, cy=ny;
					break;
				}
			}
		}

		if(got) continue;
		yes=0;
	}

	if(yes)
	{
		cout << "YES\n";
		cout << x << " " << y << endl;
	}
	else cout << "NO\n";

	return 0;
}


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

#define ll long long
#define ld long double
#define pll pair<ll,ll>
#define FILL(v,p) memset(v,p,sizeof v)
#define FIO ios::sync_with_stdio(NULL); cin.tie(NULL)
#define SZ(x) (int)x.size()
#define ALL(x) x.begin(), x.end()
#define PI acos(-1.0)

const ll MOD = 1000000007;
const ll INF = 2000000000000000001LL;
const ld EPS = 1e-9;

ll dx[]={0,0,0,1,-1};
ll dy[]={0,1,-1,0,0};

int main()
{
	FIO;

	ll n;
	cin >> n;

	ll a[n];
	for(int i=0;i<n;i++)
	{
		cin >> a[i];
	}

	set<ll> st;

	ll x=1000000000, y=0;
	for(int i=0;i<n-1;i++)
	{
		y=max(abs(a[i]-a[i+1]), y);
	}

	if(y==0)
	{
		cout << "YES\n";
		cout << 1000000000 << ' ' << 1000000000 << endl;
		return 0;
	}

	ll cx= (a[0]/y);
	ll cy= (a[0]%y);

	if(a[0]%y) cx++;
	if(cy == 0) cy=y;

	ll yes=1;
	for(int i=1;i<n;i++)
	{
		ll got=0;
		for(int j=0;j<5;j++)
		{
			ll nx= cx + dx[j];
			ll ny= cy + dy[j];

			if(nx<1 || ny<1 || nx>x || ny>y) continue;

			ll ai= y*(nx-1)+ny;
			if(ai == a[i])
			{
				got=1;
				cx= nx, cy=ny;
				//~cout << cx << ' ' << cy << " for " << a[i] << endl;
				break;
			}
		}

		if(!got) yes=0;
	}

	if(yes)
	{
		cout << "YES\n";
		cout << x << " " << y << endl;
	}
	else cout << "NO\n";

	return 0;
}


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

#define ll long long
#define ld long double
#define pll pair<ll,ll>
#define FILL(v,p) memset(v,p,sizeof v)
#define FIO ios::sync_with_stdio(NULL); cin.tie(NULL)
#define SZ(x) (int)x.size()
#define ALL(x) x.begin(), x.end()
#define PI acos(-1.0)

const ll MOD = 1000000007;
const ll INF = 2000000000000000001LL;
const ld EPS = 1e-9;

ll dx[]={0,0,1,-1};
ll dy[]={1,-1,0,0};

int main()
{
	FIO;

	ll n;
	cin >> n;

	ll a[n];
	for(int i=0;i<n;i++)
	{
		cin >> a[i];
	}

	set<ll> st;

	ll x=1000000000, y=1;
	for(int i=0;i<n-1;i++)
	{
		y=max(abs(a[i]-a[i+1]), y);
	}

	ll cx= (a[0]/y);
	ll cy= (a[0]%y);

	if(a[0]%y) cx++;
	if(cy == 0) cy=y;

	ll yes=1;
	for(int i=1;i<n;i++)
	{
		if(a[i] == a[i-1]) yes=0;

		ll got=0;
		for(int j=0;j<4;j++)
		{
			ll nx= cx + dx[j];
			ll ny= cy + dy[j];

			if(nx>=1 && ny>=1 && nx<=x && ny<=y)
			{
				ll ai= y*(nx-1)+ny;
				if(ai == a[i])
				{
					got=1;
					cx= nx, cy=ny;
					break;
				}
			}
		}

		if(got) continue;
		yes=0;
	}

	if(yes)
	{
		cout << "YES\n";
		cout << x << " " << y << endl;
	}
	else cout << "NO\n";

	return 0;
}


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

#define ll long long
#define ld long double
#define pll pair<ll,ll>
#define FILL(v,p) memset(v,p,sizeof v)
#define FIO ios::sync_with_stdio(NULL); cin.tie(NULL)
#define SZ(x) (int)x.size()
#define ALL(x) x.begin(), x.end()
#define PI acos(-1.0)

const ll MOD = 1000000007;
const ll INF = 2000000000000000001LL;
const ld EPS = 1e-9;

ll dx[]={0,0,1,-1};
ll dy[]={1,-1,0,0};

int main()
{
	FIO;

	ll n;
	cin >> n;

	ll a[n];
	for(int i=0;i<n;i++)
	{
		cin >> a[i];
	}

	set<ll> st;

	ll x=1000000000, y=0;
	for(int i=0;i<n-1;i++)
	{
		y=max(abs(a[i]-a[i+1]), y);
	}

	if(y==0)
	{
		cout << "YES\n";
		cout << 1000000000 << ' ' << 1000000000 << endl;
		return 0;
	}

	ll cx= (a[0]/y);
	ll cy= (a[0]%y);

	if(a[0]%y) cx++;
	if(cy == 0) cy=y;

	ll yes=1;
	ll ansx=1, ansy=y;
	for(int i=1;i<n;i++)
	{
		ll got=0;
		for(int j=0;j<4;j++)
		{
			ll nx= cx + dx[j];
			ll ny= cy + dy[j];

			if(nx>=1 && ny>=1 && nx<=x && ny<=y)
			{
				ll ai= y*(nx-1)+ny;
				if(ai == a[i])
				{
					got=1;
					cx= nx, cy=ny;
					ansx=max(cx,ansx), ansy=max(ansy,cy);
					continue;
				}
			}
		}

		if(got) continue;
		yes=0;
	}

	if(yes)
	{
		cout << "YES\n";
		cout << ansx << " " << ansy << endl;
	}
	else cout << "NO\n";

	return 0;
}


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

#define ll long long
#define ld long double
#define pll pair<ll,ll>
#define FILL(v,p) memset(v,p,sizeof v)
#define FIO ios::sync_with_stdio(NULL); cin.tie(NULL)
#define SZ(x) (int)x.size()
#define ALL(x) x.begin(), x.end()
#define PI acos(-1.0)

const ll MOD = 1000000007;
const ll INF = 2000000000000000001LL;
const ld EPS = 1e-9;

ll dx[]={0,0,1,-1};
ll dy[]={1,-1,0,0};

int main()
{
	FIO;

	ll n;
	cin >> n;

	ll a[n];
	for(int i=0;i<n;i++)
	{
		cin >> a[i];
	}

	set<ll> st;

	ll x=1000000000, y=0;
	for(int i=0;i<n-1;i++)
	{
		y=max(abs(a[i]-a[i+1]), y);
	}

	if(y==0)
	{
		cout << "YES\n";
		cout << 1000000000 << ' ' << 1000000000 << endl;
		return 0;
	}

	ll cx= (a[0]/y);
	ll cy= (a[0]%y);

	if(a[0]%y) cx++;
	if(cy == 0) cy=y;

	ll yes=1;
	for(int i=1;i<n;i++)
	{
		ll got=0;
		for(int j=0;j<4;j++)
		{
			ll nx= cx + dx[j];
			ll ny= cy + dy[j];

			if(nx>=1 && ny>=1 && nx<=x && ny<=y)
			{
				ll ai= y*(nx-1)+ny;
				if(ai == a[i])
				{
					got=1;
					cx= nx, cy=ny;
					break;
				}
			}
		}

		if(got) continue;
		yes=0;
	}

	if(yes)
	{
		cout << "YES\n";
		cout << x << " " << y << endl;
	}
	else cout << "NO\n";

	return 0;
}


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

#define ll long long
#define ld long double
#define pll pair<ll,ll>
#define FILL(v,p) memset(v,p,sizeof v)
#define FIO ios::sync_with_stdio(NULL); cin.tie(NULL)
#define SZ(x) (int)x.size()
#define ALL(x) x.begin(), x.end()
#define PI acos(-1.0)

const ll MOD = 1000000007;
const ll INF = 2000000000000000001LL;
const ld EPS = 1e-9;

int main()
{
	FIO;

	ll n;
	cin >> n;

	ll a[n], mn=INF, mx=0;
	for(int i=0;i<n;i++)
	{
		cin >> a[i];
	}

	set<ll> st;

	ll row=mn, col=0;
	for(int i=0;i<n-1;i++)
	{
		st.insert(abs(a[i]-a[i+1]));
	}

	auto it= st.end();
	if(st.size())
	it--;

	if(st.empty() || st.size()>2) cout << "NO\n";
	else
	{
		cout << "YES\n";
		cout << 1000000000 << " " << *it << endl;
	}

	return 0;
}


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

#define ll long long
#define ld long double
#define pll pair<ll,ll>
#define FILL(v,p) memset(v,p,sizeof v)
#define FIO ios::sync_with_stdio(NULL); cin.tie(NULL)
#define SZ(x) (int)x.size()
#define ALL(x) x.begin(), x.end()
#define PI acos(-1.0)

const ll MOD = 1000000007;
const ll INF = 2000000000000000001LL;
const ld EPS = 1e-9;

ll dx[]={0,0,1,-1};
ll dy[]={1,-1,0,0};

int main()
{
	FIO;

	ll n;
	cin >> n;

	ll a[n];
	for(int i=0;i<n;i++)
	{
		cin >> a[i];
	}

	set<ll> st;

	ll x=1000000000, y=0;
	for(int i=0;i<n-1;i++)
	{
		y=max(abs(a[i]-a[i+1]), y);
	}

	if(y==0)
	{
		cout << "YES\n";
		cout << 1000000000 << ' ' << 1000000000 << endl;
		return 0;
	}

	ll cx= (a[0]/y);
	ll cy= (a[0]%y);

	if(a[0]%y) cx++;
	if(cy == 0) cy=y;

	ll yes=1;
	for(int i=1;i<n;i++)
	{
		ll got=0;
		for(int j=0;j<4;j++)
		{
			ll nx= cx + dx[j];
			ll ny= cy + dy[j];

			if(nx>=1 && ny>=1 && nx<=x && ny<=y)
			{
				ll ai= y*(nx-1)+ny;
				if(ai == a[i])
				{
					got=1;
					cx= nx, cy=ny;
					continue;
				}
			}
		}

		if(got) continue;
		yes=0;
	}

	if(yes)
	{
		cout << "YES\n";
		cout << x << " " << y << endl;
	}
	else cout << "NO\n";

	return 0;
}


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

#define ll long long
#define ld long double
#define pll pair<ll,ll>
#define FILL(v,p) memset(v,p,sizeof v)
#define FIO ios::sync_with_stdio(NULL); cin.tie(NULL)
#define SZ(x) (int)x.size()
#define ALL(x) x.begin(), x.end()
#define PI acos(-1.0)

const ll MOD = 1000000007;
const ll INF = 2000000000000000001LL;
const ld EPS = 1e-9;

int main()
{
	FIO;

	ll n;
	cin >> n;

	ll a[n], mn=INF, mx=0;
	for(int i=0;i<n;i++)
	{
		cin >> a[i];
	}

	set<ll> st;

	ll row=mn, col=0;
	for(int i=0;i<n-1;i++)
	{
		if(abs(a[i]-a[i+1]) == 1) continue;
		st.insert(abs(a[i]-a[i+1]));
	}

	auto it= st.end();
	if(st.size())
	it--;

	if(st.empty() || st.size()>1) cout << "NO\n";
	else
	{
		cout << "YES\n";
		cout << 1000000000 << " " << *it << endl;
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;

#define pb push_back
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define fill(a,x) memset(a,x,sizeof(a))
#define F first
#define S second
#define FOR(i,a,b) for(int i = a; i<=b; ++i)
#define NFOR(i,a,b) for(int i = a; i>=b; --i)
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
const ll INF = 1e18;
const int mod = 1e9+7;
const int N = 2e5 + 10;
inline int add(int x,int y){
  x += y;
  if(x >= mod) x -= mod;
  return x;
}
inline int mul(int x,int y){
  x = (1LL * x * y) % mod;
  return x;
}
int a[N];
int main(){
    fast;
    int n;cin >> n;
    int mx = 0;
    FOR(i, 0, n - 1){
      cin >> a[i];
      mx = max(mx, a[i]);
    }
    set<int> diff;
    FOR(i, 1, n - 1){
      diff.insert(abs(a[i] - a[i - 1]));
    }
    if(diff.count(1))diff.erase(1);
    // for(auto it : diff){
    //   cout << it << " ";
    // }
    if(sz(diff) > 1){
      cout << "NO\n";return 0;
    }
    else{

      int y = 1;
      if(sz(diff) == 1)y = *diff.begin();
      if(y == 0){
        cout << "NO\n";return 0;
      }
      cout << "YES\n";
      cout << (mx + y - 1) / y << " " << y << "\n";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;

#define pb push_back
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define fill(a,x) memset(a,x,sizeof(a))
#define F first
#define S second
#define FOR(i,a,b) for(int i = a; i<=b; ++i)
#define NFOR(i,a,b) for(int i = a; i>=b; --i)
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
const ll INF = 1e18;
const int mod = 1e9+7;
const int N = 1e5 + 10;
inline int add(int x,int y){
  x += y;
  if(x >= mod) x -= mod;
  return x;
}
inline int mul(int x,int y){
  x = (1LL * x * y) % mod;
  return x;
}
int a[N];
int main(){
    fast;
    int n;cin >> n;
    int mx = 0;
    FOR(i, 0, n - 1){
      cin >> a[i];
      mx = max(mx, a[i]);
    }
    cout << fixed;
    set<int> diff;
    FOR(i, 1, n - 1){
      diff.insert(abs(a[i] - a[i - 1]));
    }
    if(sz(diff) > 2){
      cout << "NO\n";
      return 0;
    }
    else if(sz(diff) == 2){
      auto it = diff.end();
      it--;
      int y = *it;
      it--;
      int x = *it;
      if(x != 1){
        cout << "NO\n";
        return 0;
      }
      else{
        cout << "YES\n";
        cout << 1000000000 << " " << y << "\n";
        return 0;
      }
    }
    else if(sz(diff) == 1){
      auto it = diff.end();
      it--;
      int y = *it;
      if(y >= 1){
        cout << "YES\n";
        cout << 1000000000 << " " << y << "\n";
        return 0;
      }
      else{
        cout << "NO\n";
        return 0;
      }
    }
    else{
      cout << "NO\n";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;

#define pb push_back
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define fill(a,x) memset(a,x,sizeof(a))
#define F first
#define S second
#define FOR(i,a,b) for(int i = a; i<=b; ++i)
#define NFOR(i,a,b) for(int i = a; i>=b; --i)
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
const ll INF = 1e18;
const int mod = 1e9+7;
const int N = 2e5 + 10;
inline int add(int x,int y){
  x += y;
  if(x >= mod) x -= mod;
  return x;
}
inline int mul(int x,int y){
  x = (1LL * x * y) % mod;
  return x;
}
int a[N];
int main(){
    fast;
    int n;cin >> n;
    int mx = 0;
    FOR(i, 0, n - 1){
      cin >> a[i];
      mx = max(mx, a[i]);
    }
    set<int> diff;
    FOR(i, 1, n - 1){
      diff.insert(abs(a[i] - a[i - 1]));
    }
    if(diff.count(1))diff.erase(1);
    // for(auto it : diff){
    //   cout << it << " ";
    // }
    if(sz(diff) > 1){
      cout << "NO\n";return 0;
    }
    else{
      int y = 1;
      if(sz(diff) == 1)y = *diff.begin();
      if(y == 0){
        cout << "NO\n";return 0;
      }
      cout << "YES\n";
      cout << 1000000000 << " " << y << "\n";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;

#define pb push_back
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define fill(a,x) memset(a,x,sizeof(a))
#define F first
#define S second
#define FOR(i,a,b) for(int i = a; i<=b; ++i)
#define NFOR(i,a,b) for(int i = a; i>=b; --i)
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
const ll INF = 1e18;
const int mod = 1e9+7;
const int N = 1e5 + 10;
inline int add(int x,int y){
  x += y;
  if(x >= mod) x -= mod;
  return x;
}
inline int mul(int x,int y){
  x = (1LL * x * y) % mod;
  return x;
}
int a[N];
int main(){
    fast;
    int n;cin >> n;
    int mx = 0;
    FOR(i, 0, n - 1){
      cin >> a[i];
      mx = max(mx, a[i]);
    }
    set<int> diff;
    FOR(i, 1, n - 1){
      diff.insert(abs(a[i] - a[i - 1]));
    }
    if(diff.count(1))diff.erase(1);
    // for(auto it : diff){
    //   cout << it << " ";
    // }
    if(sz(diff) > 1){
      cout << "NO\n";return 0;
    }
    else{
      cout << "YES\n";
      int y = 1;
      if(sz(diff) == 1)y = *diff.begin();
      cout << (mx + y - 1) / y << " " << y << "\n";
    }

    return 0;
}


 By Dopahkiin, contest: Educational Codeforces Round 40 (Rated for Div. 2), problem: (C) Matrix Walk, Wrong answer on test 7, #

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;

#define pb push_back
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define fill(a,x) memset(a,x,sizeof(a))
#define F first
#define S second
#define FOR(i,a,b) for(int i = a; i<=b; ++i)
#define NFOR(i,a,b) for(int i = a; i>=b; --i)
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
const ll INF = 1e18;
const int mod = 1e9+7;
const int N = 2e5 + 10;
inline int add(int x,int y){
  x += y;
  if(x >= mod) x -= mod;
  return x;
}
inline int mul(int x,int y){
  x = (1LL * x * y) % mod;
  return x;
}
int a[N];
int main(){
    fast;
    int n;cin >> n;
    int mx = 0;
    FOR(i, 0, n - 1){
      cin >> a[i];
      mx = max(mx, a[i]);
    }
    set<int> diff;
    FOR(i, 1, n - 1){
      diff.insert(abs(a[i] - a[i - 1]));
    }
    if(diff.count(1))diff.erase(1);
    // for(auto it : diff){
    //   cout << it << " ";
    // }
    if(sz(diff) > 1){
      cout << "NO\n";return 0;
    }
    else{
      int y = 1;
      if(sz(diff) == 1)y = *diff.begin();
      if(y == 0){
        cout << "NO\n";return 0;
      }
      cout << "YES\n";
      cout << 1000000000 << " " << y << "\n";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;

#define pb push_back
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define fill(a,x) memset(a,x,sizeof(a))
#define F first
#define S second
#define FOR(i,a,b) for(int i = a; i<=b; ++i)
#define NFOR(i,a,b) for(int i = a; i>=b; --i)
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
const ll INF = 1e18;
const int mod = 1e9+7;
const int N = 1e5 + 10;
inline int add(int x,int y){
  x += y;
  if(x >= mod) x -= mod;
  return x;
}
inline int mul(int x,int y){
  x = (1LL * x * y) % mod;
  return x;
}
int a[N];
int main(){
    fast;
    int n;cin >> n;
    int mx = 0;
    FOR(i, 0, n - 1){
      cin >> a[i];
      mx = max(mx, a[i]);
    }
    set<int> diff;
    FOR(i, 1, n - 1){
      diff.insert(abs(a[i] - a[i - 1]));
    }
    if(sz(diff) > 2){
      cout << "NO\n";
    }
    else if(sz(diff) == 2){
      auto it = diff.end();
      it--;
      int y = *it;
      it--;
      int x = *it;
      if(y <= 1 or x != 1){
        cout << "NO\n";
      }
      else{
        cout << "YES\n";
        cout << (mx + y - 1) / y << " " << y << "\n";
      }
    }
    else if(sz(diff) == 1){
      auto it = diff.end();
      it--;
      int y = *it;
      if(y >= 1){
        cout << "YES\n";
        cout << (mx + y - 1) / y << " " << y << "\n";
      }
      else{
        cout << "NO\n";
      }
    }
    else{
      cout << "NO\n";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;

#define pb push_back
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define fill(a,x) memset(a,x,sizeof(a))
#define F first
#define S second
#define FOR(i,a,b) for(int i = a; i<=b; ++i)
#define NFOR(i,a,b) for(int i = a; i>=b; --i)
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
const ll INF = 1e18;
const int mod = 1e9+7;
const int N = 2e5 + 10;
inline int add(int x,int y){
  x += y;
  if(x >= mod) x -= mod;
  return x;
}
inline int mul(int x,int y){
  x = (1LL * x * y) % mod;
  return x;
}
int a[N];
int main(){
    fast;
    int n;cin >> n;
    int mx = 0;
    FOR(i, 0, n - 1){
      cin >> a[i];
      mx = max(mx, a[i]);
    }
    set<int> diff;
    FOR(i, 1, n - 1){
      diff.insert(abs(a[i] - a[i - 1]));
    }
    if(diff.count(1))diff.erase(1);
    // for(auto it : diff){
    //   cout << it << " ";
    // }
    if(sz(diff) > 1){
      cout << "NO\n";return 0;
    }
    else{
      int y = 1;
      if(sz(diff) == 1)y = *diff.begin();
      if(y == 0){
        cout << "NO\n";return 0;
      }
      int flag = 1;
      FOR(i, 1, n - 1){
        int cx = a[i] / y;
        int cy = a[i] % y;
        int lx = a[i - 1] / y;
        int ly = a[i - 1] % y;
        if(cx == lx and abs(cy - ly) == 1){
            flag = 1;
        }
        else if(cy == ly and abs(cx - lx) == 1){
            flag = 1;
        }
        else{
            flag = 0;
        }
      }
      if(not flag){
        cout << "NO\n";return 0;
      }
      cout << "YES\n";
      cout << 1000000000 << " " << y << "\n";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;

#define pb push_back
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define fill(a,x) memset(a,x,sizeof(a))
#define F first
#define S second
#define FOR(i,a,b) for(int i = a; i<=b; ++i)
#define NFOR(i,a,b) for(int i = a; i>=b; --i)
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
const ll INF = 1e18;
const int mod = 1e9+7;
const int N = 2e5 + 10;
inline int add(int x,int y){
  x += y;
  if(x >= mod) x -= mod;
  return x;
}
inline int mul(int x,int y){
  x = (1LL * x * y) % mod;
  return x;
}
int a[N];
int main(){
    fast;
    int n;cin >> n;
    int mx = 0;
    FOR(i, 0, n - 1){
      cin >> a[i];
      mx = max(mx, a[i]);
      a[i]--;
    }
    set<int> diff;
    FOR(i, 1, n - 1){
      diff.insert(abs(a[i] - a[i - 1]));
    }
    if(diff.count(1))diff.erase(1);
    // for(auto it : diff){
    //   cout << it << " ";
    // }
    if(sz(diff) > 1){
      cout << "NO\n";return 0;
    }
    else{
      int y = 1;
      if(sz(diff) == 1)y = *diff.begin();
      if(y == 0){
        cout << "NO\n";return 0;
      }
      //cout << y << "\n";
      int flag = 1;
      FOR(i, 1, n - 1){
        int cx = a[i] / y;
        int cy = a[i] % y;
        int lx = a[i - 1] / y;
        int ly = a[i - 1] % y;
        //cout << cx << " " << cy << "\n";
        if(cx == lx and abs(cy - ly) == 1){
            flag = 1;
        }
        else if(cy == ly and abs(cx - lx) == 1){
            flag = 1;
        }
        else{
            flag = 0;
            break;
        }
      }
      if(not flag){
        cout << "NO\n";return 0;
      }
      cout << "YES\n";
      cout << 1000000000 << " " << y << "\n";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;

#define pb push_back
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define fill(a,x) memset(a,x,sizeof(a))
#define F first
#define S second
#define FOR(i,a,b) for(int i = a; i<=b; ++i)
#define NFOR(i,a,b) for(int i = a; i>=b; --i)
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
const ll INF = 1e18;
const int mod = 1e9+7;
const int N = 2e5 + 10;
inline int add(int x,int y){
  x += y;
  if(x >= mod) x -= mod;
  return x;
}
inline int mul(int x,int y){
  x = (1LL * x * y) % mod;
  return x;
}
int a[N];
int main(){
    fast;
    int n;cin >> n;
    int mx = 0;
    FOR(i, 0, n - 1){
      cin >> a[i];
      mx = max(mx, a[i]);
    }
    set<int> diff;
    FOR(i, 1, n - 1){
      diff.insert(abs(a[i] - a[i - 1]));
    }
    if(diff.count(1))diff.erase(1);
    // for(auto it : diff){
    //   cout << it << " ";
    // }
    if(sz(diff) > 1){
      cout << "NO\n";return 0;
    }
    else{
      int y = 1;
      if(sz(diff) == 1)y = *diff.begin();
      if(y == 0){
        cout << "NO\n";return 0;
      }
      int flag = 1;
      FOR(i, 1, n - 1){
        int cx = a[i] / y;
        int cy = a[i] % y;
        int lx = a[i - 1] / y;
        int ly = a[i - 1] % y;
        if(cx == lx and abs(cy - ly) == 1){
            flag = 1;
        }
        else if(cy == ly and abs(cx - lx) == 1){
            flag = 1;
        }
        else{
            flag = 0;
            break;
        }
      }
      if(not flag){
        cout << "NO\n";return 0;
      }
      cout << "YES\n";
      cout << 1000000000 << " " << y << "\n";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;

#define pb push_back
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define fill(a,x) memset(a,x,sizeof(a))
#define F first
#define S second
#define FOR(i,a,b) for(int i = a; i<=b; ++i)
#define NFOR(i,a,b) for(int i = a; i>=b; --i)
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
const ll INF = 1e18;
const int mod = 1e9+7;
const int N = 1e5 + 10;
inline int add(int x,int y){
  x += y;
  if(x >= mod) x -= mod;
  return x;
}
inline int mul(int x,int y){
  x = (1LL * x * y) % mod;
  return x;
}
int a[N];
int main(){
    fast;
    int n;cin >> n;
    int mx = 0;
    FOR(i, 0, n - 1){
      cin >> a[i];
      mx = max(mx, a[i]);
    }
    set<int> diff;
    FOR(i, 1, n - 1){
      diff.insert(abs(a[i] - a[i - 1]));
    }
    if(diff.count(1))diff.erase(1);
    // for(auto it : diff){
    //   cout << it << " ";
    // }
    if(sz(diff) > 1){
      cout << "NO\n";return 0;
    }
    else{

      int y = 1;
      if(sz(diff) == 1)y = *diff.begin();
      if(y == 0){
        cout << "NO\n";return 0;
      }
      cout << "YES\n";
      cout << (mx + y - 1) / y << " " << y << "\n";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;

#define pb push_back
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define fill(a,x) memset(a,x,sizeof(a))
#define F first
#define S second
#define FOR(i,a,b) for(int i = a; i<=b; ++i)
#define NFOR(i,a,b) for(int i = a; i>=b; --i)
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
const ll INF = 1e18;
const int mod = 1e9+7;
const int N = 1e5 + 10;
inline int add(int x,int y){
  x += y;
  if(x >= mod) x -= mod;
  return x;
}
inline int mul(int x,int y){
  x = (1LL * x * y) % mod;
  return x;
}
int a[N];
int main(){
    fast;
    int n;cin >> n;
    int mx = 0;
    FOR(i, 0, n - 1){
      cin >> a[i];
      mx = max(mx, a[i]);
    }
    set<int> diff;
    FOR(i, 1, n - 1){
      diff.insert(abs(a[i] - a[i - 1]));
    }
    if(sz(diff) > 2){
      cout << "NO\n";
    }
    else if(sz(diff) == 2){
      auto it = diff.end();
      it--;
      int y = *it;
      if(y <= 1){
        cout << "NO\n";
      }
      else{
        cout << "YES\n";
        cout << (mx + y - 1) / y << " " << y << "\n";
      }
    }
    else if(sz(diff) == 1){
      cout << "YES\n";
      cout << mx << " " << 1 << "\n";
    }
    else{
      cout << "NO\n";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;

#define pb push_back
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define fill(a,x) memset(a,x,sizeof(a))
#define F first
#define S second
#define FOR(i,a,b) for(int i = a; i<=b; ++i)
#define NFOR(i,a,b) for(int i = a; i>=b; --i)
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
const ll INF = 1e18;
const int mod = 1e9+7;
const int N = 1e5 + 10;
inline int add(int x,int y){
  x += y;
  if(x >= mod) x -= mod;
  return x;
}
inline int mul(int x,int y){
  x = (1LL * x * y) % mod;
  return x;
}
int a[N];
int main(){
    fast;
    int n;cin >> n;
    int mx = 0;
    FOR(i, 0, n - 1){
      cin >> a[i];
      mx = max(mx, a[i]);
    }
    set<int> diff;
    FOR(i, 1, n - 1){
      diff.insert(abs(a[i] - a[i - 1]));
    }
    diff.erase(1);
    // for(auto it : diff){
    //   cout << it << " ";
    // }
    if(sz(diff) > 1){
      cout << "NO\n";return 0;
    }
    else{
      cout << "YES\n";
      int y = 1;
      if(sz(diff) == 1)y = *diff.begin();
      cout << (mx + y - 1) / y << " " << y << "\n";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;

#define pb push_back
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define fill(a,x) memset(a,x,sizeof(a))
#define F first
#define S second
#define FOR(i,a,b) for(int i = a; i<=b; ++i)
#define NFOR(i,a,b) for(int i = a; i>=b; --i)
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
const ll INF = 1e18;
const int mod = 1e9+7;
const int N = 1e5 + 10;
inline int add(int x,int y){
  x += y;
  if(x >= mod) x -= mod;
  return x;
}
inline int mul(int x,int y){
  x = (1LL * x * y) % mod;
  return x;
}
int a[N];
int main(){
    fast;
    int n;cin >> n;
    int mx = 0;
    FOR(i, 0, n - 1){
      cin >> a[i];
      mx = max(mx, a[i]);
    }
    set<int> diff;
    FOR(i, 1, n - 1){
      diff.insert(abs(a[i] - a[i - 1]));
    }
    if(sz(diff) > 2){
      cout << "NO\n";
    }
    else if(sz(diff) == 2){
      auto it = diff.end();
      it--;
      int y = *it;
      if(y <= 1){
        cout << "NO\n";
      }
      else{
        cout << "YES\n";
        cout << (mx + y - 1) / y << " " << y << "\n";
      }
    }
    else if(sz(diff) == 1){
      auto it = diff.end();
      it--;
      int y = *it;
      if(y >= 1){
        cout << "YES\n";
        cout << (mx + y - 1) / y << " " << y << "\n";
      }
      else{
        cout << "NO\n";
      }
    }
    else{
      cout << "NO\n";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;

#define pb push_back
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define fill(a,x) memset(a,x,sizeof(a))
#define F first
#define S second
#define FOR(i,a,b) for(int i = a; i<=b; ++i)
#define NFOR(i,a,b) for(int i = a; i>=b; --i)
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
const ll INF = 1e18;
const int mod = 1e9+7;
const int N = 1e5 + 10;
inline int add(int x,int y){
  x += y;
  if(x >= mod) x -= mod;
  return x;
}
inline int mul(int x,int y){
  x = (1LL * x * y) % mod;
  return x;
}
int a[N];
int main(){
    fast;
    int n;cin >> n;
    int mx = 0;
    FOR(i, 0, n - 1){
      cin >> a[i];
      mx = max(mx, a[i]);
    }
    cout << fixed;
    set<int> diff;
    FOR(i, 1, n - 1){
      diff.insert(abs(a[i] - a[i - 1]));
    }
    if(sz(diff) > 2){
      cout << "NO\n";
    }
    else if(sz(diff) == 2){
      auto it = diff.end();
      it--;
      int y = *it;
      it--;
      int x = *it;
      if(x != 1){
        cout << "NO\n";
      }
      else{
        cout << "YES\n";
        cout << 1000000000 << " " << y << "\n";
      }
    }
    else if(sz(diff) == 1){
      auto it = diff.end();
      it--;
      int y = *it;
      if(y >= 1){
        cout << "YES\n";
        cout << 1000000000 << " " << y << "\n";
      }
      else{
        cout << "NO\n";
      }
    }
    else{
      cout << "NO\n";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;

#define pb push_back
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define fill(a,x) memset(a,x,sizeof(a))
#define F first
#define S second
#define FOR(i,a,b) for(int i = a; i<=b; ++i)
#define NFOR(i,a,b) for(int i = a; i>=b; --i)
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
const ll INF = 1e18;
const int mod = 1e9+7;
const int N = 1e5 + 10;
inline int add(int x,int y){
  x += y;
  if(x >= mod) x -= mod;
  return x;
}
inline int mul(int x,int y){
  x = (1LL * x * y) % mod;
  return x;
}
int a[N];
int main(){
    fast;
    int n;cin >> n;
    int mx = 0;
    FOR(i, 0, n - 1){
      cin >> a[i];
      mx = max(mx, a[i]);
    }
    set<int> diff;
    FOR(i, 1, n - 1){
      diff.insert(abs(a[i] - a[i - 1]));
    }
    if(diff.count(1))diff.erase(1);
    // for(auto it : diff){
    //   cout << it << " ";
    // }
    if(sz(diff) > 1){
      cout << "NO\n";return 0;
    }
    else{
      int y = 1;
      if(sz(diff) == 1)y = *diff.begin();
      if(y == 0){
        cout << "NO\n";return 0;
      }
      cout << "YES\n";
      cout << 1000000000 << " " << y << "\n";
    }

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define m (1e9+7)
#define for0(i,n) for(int i=0;i<n;i++)
#define for1(i,n) for(int i=1;i<=n;i++)
#define forab(i,a,b) for(int i=a;i<=b;i++)
#define tc(t) int t;cin >>t;while(t--)
#define ll long long
#define pb(i) push_back(i)
#define fio ios_base::sync_with_stdio(false),cin.tie(NULL)
int main() {
	ll n ;
	cin >> n ;
	ll a[n+1];
	ll maxi=-1;
	for(int i=0;i<n;i++)
{	cin >> a[i];
maxi=max(a[i],maxi);

}

	ll deno=-1;
	for(int i=1;i<n;i++)
	{
	    if(abs(a[i]-a[i-1])==1)
	    {
	    continue;
	    }
	    if(abs(a[i]-a[i-1])==0)
	    {
	        cout << "NO";
	            return 0;

	    }
	    if(deno==-1)
	    deno=abs(a[i]-a[i-1]);

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

	}

	if(deno==-1)
{	cout << "YES\n";
cout << 1 << " " << maxi;
return 0;

}

for(int i=1;i<n;i++)
{
    ll c,d;
    if(abs(a[i]-a[i-1])!=1)
    continue;
    c=a[i];
    d=a[i-1];
    if(c%deno==0)
       c=deno;
    else
     c = c%deno;

    if(d%deno==0)
    d=deno;
    else
    d=d%deno;

    if(abs(c-d)==1)
    continue;

    else
    {
        cout << "NO";
        return 0;
    }
}
 cout << "YES\n";
cout << maxi << " " << deno;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define m (1e9+7)
#define for0(i,n) for(int i=0;i<n;i++)
#define for1(i,n) for(int i=1;i<=n;i++)
#define forab(i,a,b) for(int i=a;i<=b;i++)
#define tc(t) int t;cin >>t;while(t--)
#define ll long long
#define pb(i) push_back(i)
#define fio ios_base::sync_with_stdio(false),cin.tie(NULL)
int main() {
	ll n ;
	cin >> n ;
	ll a[n+1];
	ll maxi=-1;
	for(int i=0;i<n;i++)
{	cin >> a[i];
maxi=max(a[i],maxi);

}

	ll deno=-1;
	for(int i=1;i<n;i++)
	{
	    if(abs(a[i]-a[i-1])==1)
	    {
	    continue;
	    }
	    if(abs(a[i]-a[i-1])==0)
	    {
	        cout << "NO";
	            return 0;

	    }
	    if(deno==-1)
	    deno=abs(a[i]-a[i-1]);

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

	}

	if(deno==-1)
{	cout << "YES\n";
cout << maxi << " " << maxi;
return 0;

}

for(int i=1;i<n;i++)
{

    ll c,d;
    if(abs(a[i]-a[i-1])!=1)
    continue;
    c=a[i];
    d=a[i-1];
    if(deno==2)
    {
        if((c==2 and d==3) or (c==3 or d==2))
        {
            cout << "NO";
            return 0;
        }
    }
    if(c%deno==0)
       c=deno;
    else
     c = c%deno;

    if(d%deno==0)
    d=deno;
    else
    d=d%deno;

    if(abs(c-d)==1)
    continue;

    else
    {
        cout << "NO";
        return 0;
    }
}
 cout << "YES\n";
cout << maxi << " " << deno;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define m (1e9+7)
#define for0(i,n) for(int i=0;i<n;i++)
#define for1(i,n) for(int i=1;i<=n;i++)
#define forab(i,a,b) for(int i=a;i<=b;i++)
#define tc(t) int t;cin >>t;while(t--)
#define ll long long
#define pb(i) push_back(i)
#define fio ios_base::sync_with_stdio(false),cin.tie(NULL)
int main() {
	ll n ;
	cin >> n ;
	ll a[n+1];
	ll maxi=-1;
	for(int i=0;i<n;i++)
{	cin >> a[i];
maxi=max(a[i],maxi);

}

	ll deno=-1;
	for(int i=1;i<n;i++)
	{
	    if(abs(a[i]-a[i-1])==1)
	    {
	    continue;
	    }
	    if(abs(a[i]-a[i-1])==0)
	    {
	      continue;
	    }
	    if(deno==-1)
	    deno=abs(a[i]-a[i-1]);

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

	}

	if(deno==-1)
{	cout << "YES\n";
cout << 1 << " " << maxi;
return 0;

}

for(int i=1;i<n;i++)
{
    ll c,d;
    if(abs(a[i]-a[i-1])!=1)
    continue;
    c=a[i];
    d=a[i-1];
    if(c%deno==0)
       c=deno;
    else
     c = c%deno;

    if(d%deno==0)
    d=deno;
    else
    d=d%deno;

    if(abs(c-d)==1)
    continue;

    else
    {
        cout << "NO";
        return 0;
    }
}
 cout << "YES\n";
cout << maxi << " " << deno;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define m (1e9+7)
#define for0(i,n) for(int i=0;i<n;i++)
#define for1(i,n) for(int i=1;i<=n;i++)
#define forab(i,a,b) for(int i=a;i<=b;i++)
#define tc(t) int t;cin >>t;while(t--)
#define ll long long
#define pb(i) push_back(i)
#define fio ios_base::sync_with_stdio(false),cin.tie(NULL)
int main() {
	ll n ;
	cin >> n ;
	ll a[n+1];
	ll maxi=-1;

	for(int i=0;i<n;i++)
{	cin >> a[i];
maxi=max(a[i],maxi);

}

	ll deno=-1;
	for(int i=1;i<n;i++)
	{
	    if(abs(a[i]-a[i-1])==1)
	    {
	    continue;
	    }
	    if(abs(a[i]-a[i-1])==0)
	    {
	        cout << "NO";
	            return 0;

	    }
	    if(deno==-1)
	    deno=abs(a[i]-a[i-1]);

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

	}

	if(deno==-1)
{	cout << "YES\n";
cout << maxi << " " << maxi;
return 0;

}

for(int i=1;i<n;i++)
{

    ll c,d;
    if(abs(a[i]-a[i-1])!=1)
    continue;
    c=a[i];
    d=a[i-1];
    if(deno==2)
    {
       ll maxi=max(c,d);
       ll mini=min(c,d);
       if(mini%deno==0 and maxi%deno==1)
       {
           cout << "NO";
           return 0;
       }
    }
    if(c%deno==0)
       c=deno;
    else
     c = c%deno;

    if(d%deno==0)
    d=deno;
    else
    d=d%deno;

    if(abs(c-d)==1)
    continue;

    else
    {
        cout << "NO";
        return 0;
    }
}
 cout << "YES\n";
cout << maxi << " " << deno;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define m (1e9+7)
#define for0(i,n) for(int i=0;i<n;i++)
#define for1(i,n) for(int i=1;i<=n;i++)
#define forab(i,a,b) for(int i=a;i<=b;i++)
#define tc(t) int t;cin >>t;while(t--)
#define ll long long
#define pb(i) push_back(i)
#define fio ios_base::sync_with_stdio(false),cin.tie(NULL)
int main() {
	ll n ;
	cin >> n ;
	ll a[n+1];
	ll maxi=-1;
	for(int i=0;i<n;i++)
{	cin >> a[i];
maxi=max(a[i],maxi);

}

	ll deno=-1;
	for(int i=1;i<n;i++)
	{
	    if(abs(a[i]-a[i-1])==1)
	    {
	    continue;
	    }

	    if(deno==-1)
	    deno=abs(a[i]-a[i-1]);

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

	}

	if(deno==-1)
{	cout << "YES\n";
cout << 1 << " " << maxi;
return 0;

}

for(int i=1;i<n;i++)
{
    ll c,d;
    if(abs(a[i]-a[i-1])!=1)
    continue;
    c=a[i];
    d=a[i-1];
    if(c%deno==0)
       c=deno;
    else
     c = c%deno;

    if(d%deno==0)
    d=deno;
    else
    d=d%deno;

    if(abs(c-d)==1)
    continue;

    else
    {
        cout << "NO";
        return 0;
    }
}
 cout << "YES\n";
cout << maxi << " " << deno;

	return 0;
}


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

int main()
{
    ll n,k=0,diff;
    cin>>n;
    ll a[n];
    for(ll i=0;i<n;i++)
        cin>>a[i];
    for(ll i=1;i<n;i++)
    {
        if(abs(a[i]-a[i-1])==0)
        {
            cout << "NO\n";
            return 0;
        }
        if(abs(a[i]-a[i-1])==1)
        {
            if(k==0)
                continue;
            else
            {
                if(a[i-1]%diff==0 and a[i-1]%diff)
                {
                    cout<<"NO";
                    return 0;
                }
                else
                    continue;
            }
        }
        else
        {
            if(k==0){k=1;
                 diff=abs(a[i]-a[i-1]);}
            else
            {
                if(diff!=abs(a[i]-a[i-1]))
                {
                    cout<<"NO";
                    return 0;
                }
            }
        }
    }
    cout<<"YES\n";
    cout<<1000000000<<" "<<diff;
}


use std::io;

fn main() {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    let arr : Vec<i32> = s.split_whitespace().map(|s| s.parse().unwrap()).collect();
    let (_n, k) = (arr[0], arr[1]);
    let mut v = vec![0, k];
    s.clear();
    io::stdin().read_line(&mut s).unwrap();
    let arr : Vec<i32> = s.split_whitespace().map(|s| s.parse().unwrap()).collect();
    for c in arr {
        v.push(c);
    }
    v.sort();
    let mut ans = -1;
    for i in 1..v.len() {
        let tmp = v[i as usize] - v[(i-1) as usize];
        if ans < tmp {
            ans = tmp;
        }
    }
    println!("{}", ans as f64 / 2.0);
}


use std::cmp::Ordering::{Equal, Greater};
use std::fmt::Debug;
use std::io::stdin;
use std::str::FromStr;

const EPS: f64 = 1e-9;

fn read_line() -> String {
    let mut buf = String::new();
    stdin().read_line(&mut buf).expect("Failed to read a line");
    buf
}

fn read_vector<T>() -> Vec<T>
where
    T: FromStr,
    <T as FromStr>::Err: Debug,
{
    read_line().trim().split_whitespace().map(|x| x.parse::<T>().unwrap()).collect()
}

fn fmax<T>(a: T, b: T) -> T
where
    T: PartialOrd,
{
    match a.partial_cmp(&b).unwrap_or(Greater) {
        Greater => a,
        _ => b
    }
}

fn calculate_min_radius(street_length: f64, coords: &[f64]) -> f64 {
    // let mut upper = fmax(
    //     street_length - coords.first().unwrap(), coords.last().unwrap()
    // if coords.len() == 1 {
    //     return upper;
    // }

    // let mut lower = 0.0;

    let mut r = fmax(street_length - coords.last().unwrap(), *coords.first().unwrap());
    if (coords.len() > 1) {
        let max_distance: f64 =
            coords.iter().skip(1).zip(coords.iter())
            .map(|(next, prev)| (next - prev))
            .max_by(|&a, &b| a.partial_cmp(&b).unwrap_or(Equal))
            .unwrap();
        r = fmax(r, max_distance / 2.0);
    }
    r
    // dbg!(max_distance);
    // let is_sufficient_radius = |r| r >= max_distance;

    // let is_sufficient_radius = |r| {
    //     // dbg!(r);
    //     let mut min_coord_without_light: f64 = 0.0;
    //     let mut pos: usize = 0;
    //     while pos < coords.len() {
    //         // println!("---");
    //         // dbg!(pos);
    //         // dbg!(min_coord_without_light);
    //         if coords[pos] - r > min_coord_without_light {
    //             // let result = false;
    //             // dbg!(result);
    //             return false;
    //         }
    //         let mut left = pos;
    //         let mut right = coords.len() - 1;
    //         while right - left > 1 {
    //             let middle = left + (right - left) / 2;
    //             // dbg!(left);
    //             // dbg!(middle);
    //             // dbg!(right);
    //             // std::thread::sleep(std::time::Duration::from_secs(1));
    //             if coords[middle] - r > min_coord_without_light {
    //                 right = middle
    //             } else {
    //                 left = middle
    //             }
    //         }
    //         // dbg!(left);
    //         min_coord_without_light = coords[left] + r;
    //         pos = left + 1;
    //     }
    //     // let result = min_coord_without_light >= street_length;
    //     // dbg!(result);
    //     // result
    //     min_coord_without_light >= street_length
    //     // for x in coords {
    //     //     if x - r > min_coord_without_light {
    //     //         return false;
    //     //     } else {
    //     //         min_coord_without_light = fmax(x + r, min_coord_without_light);
    //     //     }
    //     // }
    //     // min_coord_without_light >= street_length
    // };

    // while upper - lower >= EPS {
    //     let middle = lower + (upper - lower) / 2.0;
    //     // println!("===========");
    //     // dbg!(lower);
    //     // dbg!(upper);
    //     if is_sufficient_radius(middle) {
    //         upper = middle;
    //     } else {
    //         lower = middle;
    //     }
    //     // std::thread::sleep(std::time::Duration::from_secs(1));
    // }
    // upper
}

fn main() {
    let (_, street_length) = {
        let x = read_vector::<usize>();
        (x[0], x[1])
    };
    let coords: Vec<f64> = {
        let mut x = read_vector::<f64>();
        x.sort_unstable_by(|a, b| a.partial_cmp(b).unwrap_or(Equal));
        x.dedup();
        x
    };
    println!("{}", calculate_min_radius(street_length as f64, &coords));
}


use std::cmp::Ordering::{Greater, Equal};
use std::fmt::Debug;
use std::io::stdin;
use std::str::FromStr;

const EPS: f64 = 1e-9;

fn read_line() -> String {
    let mut buf = String::new();
    stdin().read_line(&mut buf).expect("Failed to read a line");
    buf
}

fn read_vector<T>() -> Vec<T>
where
    T: FromStr,
    <T as FromStr>::Err: Debug,
{
    read_line().trim().split_whitespace().map(|x| x.parse::<T>().unwrap()).collect()
}

fn fmax<T>(a: T, b: T) -> T
where
    T: PartialOrd,
{
    match a.partial_cmp(&b).unwrap_or(Greater) {
        Greater => a,
        _ => b
    }
}

fn calculate_min_radius(street_length: f64, coords: &[f64]) -> f64 {
    let mut upper = fmax(
        street_length - coords.first().unwrap(), coords.last().unwrap() - street_length
    );
    let mut lower = 0.0;
    let is_sufficient_radius = |r| {
        let mut min_coord_without_light: f64 = 0.0;
        for x in coords {
            if x - r > min_coord_without_light {
                return false;
            } else {
                min_coord_without_light = fmax(x + r, min_coord_without_light);
            }
        }
        min_coord_without_light >= street_length
    };

    while upper - lower >= EPS {
        // println!("middle {}", middle);
        let middle = (upper + lower) / 2.0;
        if is_sufficient_radius(middle) {
            upper = middle;
        } else {
            lower = middle;
        }
    }
    upper
}

fn main() {
    let (_, street_length) = {
        let x = read_vector::<usize>();
        (x[0], x[1])
    };
    let coords: Vec<f64> = {
        let mut x = read_vector::<f64>();
        x.sort_unstable_by(|a, b| a.partial_cmp(b).unwrap_or(Equal));
        x.dedup();
        x
    };
    println!("{}", calculate_min_radius(street_length as f64, &coords));
}


use std::cmp::Ordering::{Equal, Greater};
use std::fmt::Debug;
use std::io::stdin;
use std::str::FromStr;

const EPS: f64 = 1e-9;

fn read_line() -> String {
    let mut buf = String::new();
    stdin().read_line(&mut buf).expect("Failed to read a line");
    buf
}

fn read_vector<T>() -> Vec<T>
where
    T: FromStr,
    <T as FromStr>::Err: Debug,
{
    read_line().trim().split_whitespace().map(|x| x.parse::<T>().unwrap()).collect()
}

fn fmax<T>(a: T, b: T) -> T
where
    T: PartialOrd,
{
    match a.partial_cmp(&b).unwrap_or(Greater) {
        Greater => a,
        _ => b
    }
}

fn calculate_min_radius(street_length: f64, coords: &[f64]) -> f64 {
    let mut upper = fmax(
        street_length - coords.first().unwrap(), coords.last().unwrap() - street_length
    );
    if coords.len() == 1 {
        return upper;
    }

    let mut lower = 0.0;

    let max_distance: f64 =
        coords.iter().skip(1).zip(coords.iter())
        .map(|(next, prev)| (next - prev) / 2.0)
        .max_by(|&a, &b| a.partial_cmp(&b).unwrap_or(Equal))
        .unwrap();
    let max_distance = fmax(
        max_distance,
        fmax(street_length - coords.last().unwrap(), *coords.first().unwrap())
    );
    // dbg!(max_distance);
    let is_sufficient_radius = |r| r >= max_distance;

    // let is_sufficient_radius = |r| {
    //     // dbg!(r);
    //     let mut min_coord_without_light: f64 = 0.0;
    //     let mut pos: usize = 0;
    //     while pos < coords.len() {
    //         // println!("---");
    //         // dbg!(pos);
    //         // dbg!(min_coord_without_light);
    //         if coords[pos] - r > min_coord_without_light {
    //             // let result = false;
    //             // dbg!(result);
    //             return false;
    //         }
    //         let mut left = pos;
    //         let mut right = coords.len() - 1;
    //         while right - left > 1 {
    //             let middle = left + (right - left) / 2;
    //             // dbg!(left);
    //             // dbg!(middle);
    //             // dbg!(right);
    //             // std::thread::sleep(std::time::Duration::from_secs(1));
    //             if coords[middle] - r > min_coord_without_light {
    //                 right = middle
    //             } else {
    //                 left = middle
    //             }
    //         }
    //         // dbg!(left);
    //         min_coord_without_light = coords[left] + r;
    //         pos = left + 1;
    //     }
    //     // let result = min_coord_without_light >= street_length;
    //     // dbg!(result);
    //     // result
    //     min_coord_without_light >= street_length
    //     // for x in coords {
    //     //     if x - r > min_coord_without_light {
    //     //         return false;
    //     //     } else {
    //     //         min_coord_without_light = fmax(x + r, min_coord_without_light);
    //     //     }
    //     // }
    //     // min_coord_without_light >= street_length
    // };

    while upper - lower >= EPS {
        let middle = lower + (upper - lower) / 2.0;
        // println!("===========");
        // dbg!(lower);
        // dbg!(upper);
        if is_sufficient_radius(middle) {
            upper = middle;
        } else {
            lower = middle;
        }
        // std::thread::sleep(std::time::Duration::from_secs(1));
    }
    upper
}

fn main() {
    let (_, street_length) = {
        let x = read_vector::<usize>();
        (x[0], x[1])
    };
    let coords: Vec<f64> = {
        let mut x = read_vector::<f64>();
        x.sort_unstable_by(|a, b| a.partial_cmp(b).unwrap_or(Equal));
        x.dedup();
        x
    };
    println!("{}", calculate_min_radius(street_length as f64, &coords));
}


use std::cmp::Ordering::{Greater, Equal};
use std::fmt::Debug;
use std::io::stdin;
use std::str::FromStr;

const EPS: f64 = 1e-9;

fn read_line() -> String {
    let mut buf = String::new();
    stdin().read_line(&mut buf).expect("Failed to read a line");
    buf
}

fn read_vector<T>() -> Vec<T>
where
    T: FromStr,
    <T as FromStr>::Err: Debug,
{
    read_line().trim().split_whitespace().map(|x| x.parse::<T>().unwrap()).collect()
}

fn fmax<T>(a: T, b: T) -> T
where
    T: PartialOrd,
{
    match a.partial_cmp(&b).unwrap_or(Greater) {
        Greater => a,
        _ => b
    }
}

fn calculate_min_radius(street_length: f64, coords: &[f64]) -> f64 {
    let mut upper = fmax(
        street_length - coords.first().unwrap(), coords.last().unwrap() - street_length
    );
    let mut lower = 0.0;

    let is_sufficient_radius = |r| {
        // dbg!(r);
        let mut min_coord_without_light: f64 = 0.0;
        let mut pos: usize = 0;
        while pos < coords.len() {
            // println!("---");
            // dbg!(pos);
            // dbg!(min_coord_without_light);
            if coords[pos] - r > min_coord_without_light {
                // let result = false;
                // dbg!(result);
                return false;
            }
            let mut left = pos;
            let mut right = coords.len() - 1;
            while right - left > 1 {
                let middle = left + (right - left) / 2;
                // dbg!(left);
                // dbg!(middle);
                // dbg!(right);
                // std::thread::sleep(std::time::Duration::from_secs(1));
                if coords[middle] - r > min_coord_without_light {
                    right = middle
                } else {
                    left = middle
                }
            }
            // dbg!(left);
            min_coord_without_light = coords[left] + r;
            pos = left + 1;
        }
        // let result = min_coord_without_light >= street_length;
        // dbg!(result);
        // result
        min_coord_without_light >= street_length
        // for x in coords {
        //     if x - r > min_coord_without_light {
        //         return false;
        //     } else {
        //         min_coord_without_light = fmax(x + r, min_coord_without_light);
        //     }
        // }
        // min_coord_without_light >= street_length
    };

    while upper - lower >= EPS {
        let middle = lower + (upper - lower) / 2.0;
        // println!("===========");
        // dbg!(lower);
        // dbg!(upper);
        if is_sufficient_radius(middle) {
            upper = middle;
        } else {
            lower = middle;
        }
        // std::thread::sleep(std::time::Duration::from_secs(1));
    }
    upper
}

fn main() {
    let (_, street_length) = {
        let x = read_vector::<usize>();
        (x[0], x[1])
    };
    let coords: Vec<f64> = {
        let mut x = read_vector::<f64>();
        x.sort_unstable_by(|a, b| a.partial_cmp(b).unwrap_or(Equal));
        x.dedup();
        x
    };
    println!("{}", calculate_min_radius(street_length as f64, &coords));
}


use std::cmp::Ordering::{Equal, Greater};
use std::fmt::Debug;
use std::io::stdin;
use std::str::FromStr;

const EPS: f64 = 1e-9;

fn read_line() -> String {
    let mut buf = String::new();
    stdin().read_line(&mut buf).expect("Failed to read a line");
    buf
}

fn read_vector<T>() -> Vec<T>
where
    T: FromStr,
    <T as FromStr>::Err: Debug,
{
    read_line().trim().split_whitespace().map(|x| x.parse::<T>().unwrap()).collect()
}

fn fmax<T>(a: T, b: T) -> T
where
    T: PartialOrd,
{
    match a.partial_cmp(&b).unwrap_or(Greater) {
        Greater => a,
        _ => b
    }
}

fn calculate_min_radius(street_length: f64, coords: &[f64]) -> f64 {
    let mut upper = fmax(
        street_length - coords.first().unwrap(), coords.last().unwrap() - street_length
    );
    if coords.len() == 1 {
        return upper;
    }

    let mut lower = 0.0;

    let max_distance: f64 =
        coords.iter().skip(1).zip(coords.iter())
        .map(|(next, prev)| (next - prev) / 2.0)
        .max_by(|&a, &b| a.partial_cmp(&b).unwrap_or(Equal))
        .unwrap();
    let max_distance = fmax(
        max_distance,
        fmax(street_length - coords.last().unwrap(), *coords.first().unwrap())
    );
    max_distance
    // dbg!(max_distance);
    // let is_sufficient_radius = |r| r >= max_distance;

    // let is_sufficient_radius = |r| {
    //     // dbg!(r);
    //     let mut min_coord_without_light: f64 = 0.0;
    //     let mut pos: usize = 0;
    //     while pos < coords.len() {
    //         // println!("---");
    //         // dbg!(pos);
    //         // dbg!(min_coord_without_light);
    //         if coords[pos] - r > min_coord_without_light {
    //             // let result = false;
    //             // dbg!(result);
    //             return false;
    //         }
    //         let mut left = pos;
    //         let mut right = coords.len() - 1;
    //         while right - left > 1 {
    //             let middle = left + (right - left) / 2;
    //             // dbg!(left);
    //             // dbg!(middle);
    //             // dbg!(right);
    //             // std::thread::sleep(std::time::Duration::from_secs(1));
    //             if coords[middle] - r > min_coord_without_light {
    //                 right = middle
    //             } else {
    //                 left = middle
    //             }
    //         }
    //         // dbg!(left);
    //         min_coord_without_light = coords[left] + r;
    //         pos = left + 1;
    //     }
    //     // let result = min_coord_without_light >= street_length;
    //     // dbg!(result);
    //     // result
    //     min_coord_without_light >= street_length
    //     // for x in coords {
    //     //     if x - r > min_coord_without_light {
    //     //         return false;
    //     //     } else {
    //     //         min_coord_without_light = fmax(x + r, min_coord_without_light);
    //     //     }
    //     // }
    //     // min_coord_without_light >= street_length
    // };

    // while upper - lower >= EPS {
    //     let middle = lower + (upper - lower) / 2.0;
    //     // println!("===========");
    //     // dbg!(lower);
    //     // dbg!(upper);
    //     if is_sufficient_radius(middle) {
    //         upper = middle;
    //     } else {
    //         lower = middle;
    //     }
    //     // std::thread::sleep(std::time::Duration::from_secs(1));
    // }
    // upper
}

fn main() {
    let (_, street_length) = {
        let x = read_vector::<usize>();
        (x[0], x[1])
    };
    let coords: Vec<f64> = {
        let mut x = read_vector::<f64>();
        x.sort_unstable_by(|a, b| a.partial_cmp(b).unwrap_or(Equal));
        x.dedup();
        x
    };
    println!("{}", calculate_min_radius(street_length as f64, &coords));
}