#include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int H,W,T; cin >> H >> W >> T; int sx,sy,gx,gy; cin >> sx >> sy >> gx >> gy; sx--; sy--; gx--; gy--; vector> ok(H,vector(W)); vector> A(H,vector(W)); for(int i=0; i> c; A.at(i).at(k) = c-'0'+1; } ok.at(sx).at(sy) = true; bool yes = false; vector dx = {-1,0,1,0},dy = {0,1,0,-1}; for(int i=1; i> next(H,vector(W)); for(int x=0; x= H || ny < 0 || ny >= W) continue; if((i+1)%A.at(nx).at(ny)) next.at(nx).at(ny) = true; } if((i+1)%A.at(x).at(y)) next.at(x).at(y) = true; } swap(ok,next); if(ok.at(gx).at(gy)) yes = true; } if(yes) cout << "Yes" << endl; else cout << "No" << endl; }