#include #include using namespace std; int cmp(int a, int b) { return a > b; } int mins(int a, int b) { if (a < b) return a; return b; } int abss(int a) { if (a < 0) return -a; return a; } int main() { int n, m; scanf("%d", &n); while (scanf("%d%d", &m, &n) != EOF) { int cntnum = 0; int t; for (int i = 0; i < n * m; i++) { scanf("%d", &t); if (t == 0) cntnum++; } if ((cntnum % 2) == (!(m % 2 == 1 || n % 2 == 1))) { goto success; } else { goto fail; } success: printf("YES\n"); goto end; fail: printf("NO\n"); goto end; end: 0; } return 0; }