#include <bits/stdc++.h>
using namespace std;
#define ll long long
bool solve() {
int n, m, k;
cin >> n >> m >> k;
vector<int> v(n, 111);
for (int i = 0; i < n; ++i) {
for (int j = 0, x; j < m; ++j) {
cin >> x;
if (x >= 0) v[i] = min(v[i], x);
}
}
for (int i = 0; i < n; ++i) {
if (v[i] == 111 || k - v[i] < 0) return 0;
k -= v[i];
}
return 1;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
#ifndef ONLINE_JUDGE
freopen("in.txt", "r", stdin);
freopen("out.txt", "w", stdout);
#endif
cout << (solve() ? "YES" : "NO") << '\n';
return 0;
}
Copy