#include <bits/stdc++.h>

using namespace std;

main() {
    int N; scanf("%d", &N);
    int A[N + 5], B[N + 5];
    for (int k = 0; k < 2; k++) {
        for (int i = 0; i < N; i++) {
            if (k == 1) scanf("%d", &B[i]);
            else scanf("%d", &A[i]);
        }
    }
    int ans = 0;
    for (int i = 0; i < N; i++) ans += A[i] * B[i];
    
    if (ans == 0) printf("Yes");
    else printf("No");
}

#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <deque>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <cassert>
#include <iostream>
#include <stdio.h>
#include <time.h>
 
using namespace std;

typedef long long ll;
 
#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)

#define MOD 1000000007

ll d[100100];

int main(){
  clr(d,0);
  ll n;
  cin>>n;
  vector<ll> v;
  ll sum = 0;
  rep(i,0,n){
    ll a;
    cin>>a;
    v.pb(a);
  }
  sort(all(v));
  rep(i,0,v.sz){
    d[i] += v[i];
    d[i+1] += d[i];
  }
  double mn = 1000000000000000000.;
  rep(i,0,v.sz){
    double e = 1.*v[i]/2+(1.*d[n]-1.*d[i]-1.*v[i]*(n-1-i))/n;
    mn = min(mn,e);
  }
  printf("%20.20f\n", mn);
}