#define G,abs(t=s[p][q]-s[p+n][q+m])<2&&f(p+n,q+m),s[p+n+n][q+m+m]-s[p][q]|t<0||f(p+n+n,q+m+m),t=n,n=m,m=-t char s[199][99];n=1,m; f(p,q,t){s[p+99][q]++||(1 G G G G);} main(i,a,b,x,y){for(scanf("%*d%*d%d%d%d%d ",&a,&b,&x,&y);gets(s[i++]+1););f(a,b);n=!puts(s[x+99][y]?"YES":"NO");}