func_code_string: #include <bits/stdc++.h>   using namespace std;   long long mod = 1e9;   void err(istream_iterator<string> it) {}   template <typename T, typename... Args>   void err(istream_iterator<string> it, T a, Args... args) {     cerr << *it <<   =   << a << endl;     err(++it, args...);   }   long long powm(long long a, long long b, long long mod) {     long long res = 1;     while (b) {       if (b & 1) res = (res * a) % mod;       a = (a * a) % mod;       b >>= 1;     }     return res;   }   bool sortinrev(const pair<int, int> &a, const pair<int, int> &b) {     return (a.first > b.first);   }   void solve() {     long long n;     cin >> n;     vector<long long> a(n);     for (long long i = 0; i < (n); i++) {       cin >> a[i];     };     if (n == 1) {       cout <<  YES n ;       cout << 1 <<     << a[0] << endl;       return;     }     long long x = 0, y = 0, m = 0;     for (long long i = 0; i < (n - 1); i++) {       m = max({m, a[i], a[i + 1]});       if (abs(a[i] - a[i + 1]) == 0) {         cout <<  NO n ;         return;       }       if (abs(a[i] - a[i + 1]) != 1 and y == 0) {         y = abs(a[i] - a[i + 1]);       } else if (abs(a[i] - a[i + 1]) != 1 and y != 0) {         if (y != abs(a[i] - a[i + 1])) {           cout <<  NO n ;           return;         }       }     }     if (y == 0) {       cout <<  YES n ;       cout << (mod) <<     << (mod) << endl;       return;     }     for (long long i = 0; i < (n - 1); i++) {       if (abs(a[i] - a[i + 1]) == 1) {         if (a[i] % y == 0 and a[i + 1] == a[i] + 1) {           cout <<  NO n ;           return;         }         if (a[i + 1] % y == 0 and a[i] == a[i + 1] + 1) {           cout <<  NO n ;           return;         }       }     }     cout <<  YES n ;     cout << (m / y) + 1 <<     << y << endl;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     solve();   }   