#define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; #include using namespace std; const int MAX=24002400; int G[MAX][5]; const int k=2520; int dh[]={1,0,0,0,-1}; int dw[]={0,1,0,-1,0}; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); int h,w,t; cin>>h>>w>>t; int sy,sx,gy,gx; cin>>sy>>sx>>gy>>gx; sy--,sx--,gy--,gx--; vector S(h); rep(i,h) cin>>S[i]; vector> A(h,vector(w)); rep(i,h) rep(j,w) A[i][j]=S[i][j]-'0'; auto f=[&](int i,int j,int l){ return (A[i][j]-l+k)%(A[i][j]+1); }; auto g=[&](int i,int j,int l){ return l*h*w+i*w+j; }; for(int l=0;l=h || nj>=w) continue; if(f(ni,nj,l+1)!=0) G[a][m]=g(ni,nj,l+1); } } } queue que; vector vis(h*w*t); que.push(g(sy,sx,0)); vis[g(sy,sx,0)]=1; while(que.size()){ auto v=que.front(); que.pop(); rep(m,5){ if(G[v][m]==0) continue; int nv=G[v][m]; if(vis[nv]) continue; vis[nv]=1; que.push(nv); } } rep(l,t){ if(vis[g(gy,gx,l)]){ cout<<"Yes"<