#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <climits>
#include <cmath>
#include <complex>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <cstdint>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
#define MP make_pair
#define PB push_back
#define inf 1000000007
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)
#define all(x) (x).begin(),(x).end()

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}
 
template<class T> inline bool chmax(T &a, T b){
    if(a<b){
        a = b;
        return true;
    }
    return false;
}

template<class T> inline bool chmin(T &a, T b){
    if(a>b){
        a = b;
        return true;
    }
    return false;
}
string s[110];
int main(){
    int n;
    cin >> n;
    rep(i,n){
        cin >> s[i];
    }
    rep(k,n){
        rep(i,n){
            rep(j,n){
                if(s[i][k]=='1'&&s[k][j]=='1'){
                    s[i][j] = '1';
                }
            }
        }
    }
    long double res = 0;
    rep(i,n){
        long double tmp = 1.0;
        int c = 1;
        rep(j,n){
            if(s[j][i]=='1'&&i!=j){
                c++;
            }
        }
        tmp /= (long double )c;
        
        res += tmp;
        // cerr << c << " " << tmp << endl;
    }
    cout.precision(30);
    cout << fixed << res << endl;
    return 0;
}
#include "bits/stdc++.h"
using namespace std;

#define ll long long int 
#define pb(a) push_back(a)
#define vll vector<ll>
#define loop(i, n) for(ll i=1;i<=n;i++)
#define loop0(i, n) for(ll i=0;i<n;i++)
#define in(i) scanf("%lld", &i);
#define out(i) printf("%lld", i)
#define pll pair<ll, ll>
#define vpll vector<pair<ll, ll>>
#define mp(i, j) make_pair(i, j);
const ll mod = 1000000007;
const ll big = 2999999999999999999;
const ll small = -2999999999999999999;
void in2(ll& a, ll& b) { in(a); in(b); }
void in3(ll& a, ll& b, ll& c) { in(a); in(b); in(c); }
void swap(ll& a, ll& b) { a = a+b; b = a-b; a = a-b; }
void arrayIn(vll& a, ll& n) { loop0(i, n) in(a[i]); }

ll n, m, a, b, c, u, v, p, q, k;


int main()
{
  in3(a, b, c);
  ll mini = min({a, b, c}), maxi = max({a, b, c});
  ll mid = a+b+c-mini-maxi;
  if(mid-mini == maxi-mid)
    cout<<"Yes\n";
  else
    cout<<"No\n";
}

