// tested by Hightail - https://github.com/dj3500/hightail
import std.stdio, std.string, std.conv, std.algorithm;
import std.range, std.array, std.math, std.typecons, std.container, core.bitop;

int n;

void main() {
    scan(n);
    auto a = new int[][](n, n);
    iota(n).each!(i => a[i][] = readln.split.to!(int[]));

    foreach (i ; 0 .. n) {
        foreach (j ; 0 .. n) {
            if (a[i][j] != 1) {
                bool flag;

                foreach (k ; 0 .. n) {
                    if (k == i) continue;

                    int x = a[i][j] - a[k][j];

                    foreach (l ; 0 .. n) {
                        if (x == a[i][l]) {
                            flag = true;
                            break;
                        }
                    }

                    if (flag) break;
                }

                if (!flag) {
                    writeln("No");
                    return;
                }
            }
        }
    }

    writeln("Yes");
}


void scan(T...)(ref T args) {
    string[] line = readln.split;
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}


void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}