#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <ctime>
#include <list>
#include <numeric>
#include <utility>
#include <ctime>
#define INF 100000000
#define LINF 9000000000000000000
#define mod 1000000007
 
#define rep(i,n) for(int i=0;i<int(n);i++)
#define REP(i,a,b) for(int i=(a);i<int(b);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back
#define mp make_pair
#define MOD(x) (x%(mod))
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> pi;
 
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
bool debug=false;

/*---------------------------------------------------*/

int maze[105][105];
int w,h,xs,ys,xg,yg;

bool bfs(){
  queue<int>que;
  que.push(xs);
  que.push(ys);
  while(que.size()){
    int x=que.front();que.pop();
    int y=que.front();que.pop();
    if(x==xg&&y==yg)return true;
    for(int i=0;i<4;i++){
      if(0<=x+dx[i]&&x+dx[i]<=w&&0<=y+dy[i]&&y+dy[i]<=h&&maze[y+dy[i]][x+dx[i]]==maze[ys][xs]){
	que.push(x+dx[i]);
	que.push(y+dy[i]);
	maze[y+dy[i]][x+dx[i]]=-1;
      }
    }
  }
  return false;
}

int main(){
  while(cin>>w>>h){
    if(w==0&&h==0)break;
    cin>>xs>>ys;
    cin>>xg>>yg;
    rep(i,h/2){
      rep(j,w/4){
	cin>>maze[i][j];
      }
    }
    if(bfs())cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }
  return 0;
}