#include using namespace std; struct frac{ long long num, den; frac(){ } frac(int x): num(x), den(1){ } frac(long long x, long long y){ long long g = gcd(x, y); num = x / g; den = y / g; if (den < 0){ num *= -1; den *= -1; } } frac operator +(frac x){ return frac(num * x.den + x.num * den, den * x.den); } frac operator -(frac x){ return frac(num * x.den + x.num * den, den * x.den); } frac operator *(frac x){ return frac(num * x.num, den * x.den); } frac operator /(frac x){ return frac(num * x.den, den * x.num); } }; int solve(vector> A){ int N = A.size(); int M = A[0].size(); vector> A2(N, vector(M)); for (int i = 0; i < N; i++){ for (int j = 0; j < M; j++){ A2[i][j] = frac(A[i][j]); } } int ans = 0; for (int i = 0; i < M; i++){ bool ok = false; for (int j = ans; j < N; j++){ if (A2[j][i].num != 0){ ok = true; swap(A2[ans], A2[j]); break; } } if (ok){ int p = ans; frac x = frac(1) / A2[p][i]; for (int j = i; j < M; j++){ A2[p][j] = A2[p][j] * x; } for (int j = 0; j < N; j++){ if (j != p){ frac m = A2[j][i]; for (int k = i; k < M; k++){ A2[j][k] = A2[j][k] - m * A2[p][k]; } } } ans++; } } return ans; } int main(){ int L, M, N; cin >> L >> M >> N; vector> A(L, vector(M)); for (int i = 0; i < L; i++){ for (int j = 0; j < M; j++){ cin >> A[i][j]; } } vector> B(M, vector(N)); for (int i = 0; i < M; i++){ for (int j = 0; j < N; j++){ cin >> B[i][j]; } } bool ok = true; for (int i = 0; i < N; i++){ for (int j = 0; j < L; j++){ long long sum = 0; for (int k = 0; k < M; k++){ sum += A[j][k] * B[k][i]; } if (sum != 0){ ok = false; } } } if (!ok){ cout << "No" << endl; } else { if (solve(A) + solve(B) == M){ cout << "Yes" << endl; } else { cout << "No" << endl; } } }