#include<bits/stdc++.h>
using namespace std;
    #define author          "Sihare0riginals"
    #define ss              string 
    #define lli             long long int
    #define ld              long double
    #define f               first
    #define s               second
    #define all(v)          v.begin(),v.end()
    #define I(a,i)          memset(a,i,sizeof(a));
    #define pb              push_back
    #define mp              make_pair
    #define L(i,start,end)  for(lli i=start;i<=end;i++)
    #define R(i,start,end)  for(lli i=start;i>=end;i--)
    #define ip(n)           cin>>n;lli ip[n+1];L(i,1,n)cin>>ip[i];
const lli LINF = 1e18,mod=1e9+7;
void Bl0ck_M0mb0();
 
 
signed main()
{
    Bl0ck_M0mb0();
    lli t=1;
    //cin>>t;
    while(t--){
        ss s1;
        cin>>s1;
        lli n,l=0,cnt1=0,cnt2=0;
        n=s1.length();
        n--;
        while(n>=0&&s1[n]=='0')
        {
            n--;
            cnt1++;
        }
        while(l<s1.length()&&s1[l]=='0')
        {
            cnt2++;
            l++;
        }
        //cout<<l<<" "<<n<<" "<<cnt1<<" "<<cnt2<<endl;
        bool poss=true;
        while(l<=n)
        {
            if(s1[l]!=s1[n])    
            {
                poss=false;
                break;
            }
            l++;
            n--;
        }
        if(poss&&cnt1>=cnt2)
            cout<<"Yes"<<endl;
        else
            cout<<"No"<<endl;
    }
    return 0;
}





























void Bl0ck_M0mb0(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    #ifndef ONLINE_JUDGE
    freopen("ip.txt","r",stdin);
    freopen("op.txt","w",stdout);
    #endif
}
/*
#define dbg1D(i,start,end,arr) for(lli i=start;i<=end;i++) cout<<i<<"th : "<<arr[i]<<endl;
#define dbg2D(i,j,s1,e1,s2,e2,arr) for(lli i=s1;i<=e1;i++){cout<<i<<"th :";for(lli j=s2;j<=e2;j++)cout<<arr[i][j]<<" ";cout<<endl;}
#define M map<lli,lli> \n #define sz(s) s.size()-1
#define P pair<lli,lli> 
#define V vector<lli>
lli dx[4]={-1, 0, 0, +1};
lli dy[4]={0, -1, +1, 0};
lli power(lli a,lli b,lli m){ if(b==0) return 1; if(b==1) return a%m;
    lli t=power(a,b/2,m); t=(t*t)%m; if(b&1) t=(t*a)%m; return t;}
lli modInverse(lli a, lli m) { return power(a, m-2, m); } */
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define int long long
#define ll long long
#define F(type, i, a, b, incr) for (type i = a; i <= (type)(b); i += (type)(incr))
#define RF(type, i, a, b, decr) for (type i = a; i >= (type)(b); i -= (type)(decr))
#define sz(a) sizeof(a)
#define deb(a) cerr << " [" << #a << "->" << a << "] "
#define next_line cerr << '\n'
#define all(a) a.begin(), a.end()
#define iter(it, s) for (auto it = s.begin(); it != s.end(); it++)
#define setbits(x) __builtin_popcountll(x)
using namespace __gnu_pbds;
using namespace std;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
typedef pair<int, int> pii;
typedef pair<ll,ll> pll;

const int N = 1e5 + 1;
int arr[N], n;

double fun(double x){
    double ans =0 ;
    for(int i =0 ; i < n;  i++){
        ans += (x + (double)(arr[i]) - min((double)(arr[i]), 2.0*x));
    }
    return ans;
}

void solve()
{
    cin>> n;
    int mn = 1e9;
    for(int i =0 ; i < n;i ++){
        cin>> arr[i];
        mn = min(arr[i], mn);
    }    
    double l = (double(mn) / 2.0), r = 1e9, e = 1e-7;
    while(r - l >= e){
        double m1 = l + (r - l) / 3;
        double m2 = r - (r - l) / 3;
        double v1 = fun(m1);
        double v2 = fun(m2);
        if(v1 > v2){
            l = m1;
        }else{
            r = m2;
        }
    }
    double x = r;
    double ans = fun(x) / (double(n));
    cout<< ans << '\n';
}

signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    #ifndef ONLINE_JUDGE
	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);
	// freopen("Debug.txt", "w", stderr);
    #else
    #endif
    cout << fixed << setprecision(10);
    int _t =1;
    // cin>>_t;
    F(int, i, 1, _t, 1){
	// cout << "Case #" << i << ": ";
	solve();
    }
}
