#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int N; cin >> N; vector> D(N,vector(N)); for(auto &h : D) for(auto &w : h) cin >> w; bool three = true,four = true; for(int i=0; i D.at(i).at(l)+D.at(l).at(k)) three = false; if(D.at(i).at(k) > max(D.at(i).at(l),D.at(l).at(k))) four = false; } if(three) cout << "Yes\n"; else cout << "No\n"; if(four) cout << "Yes\n"; else cout << "No\n"; }