#define A(u,v),abs(m[x][y]-m[x+u][y+v])<2&&f(x+u,y+v),m[x][y]==m[x+u*2][y+v*2]&&m[x][y]>m[x+u][y+v]&&f(x+u*2,y+v*2) a;b;char*r="NO",m[60][60],u[60][60];f(x,y){u[y][x]++||(r=x-a|y-b?r:"YES"A(-1,0)A(1,0)A(0,-1)A(0,1));}main(i,x,y){for(scanf("%*d%*d%d%d%d%d ",&x,&y,&a,&b);gets(m[i++]+1););f(x,y);puts(r);}