#include <iostream>
#include <queue>
#include <utility>
using namespace std;
int m,n;
int arr[101][101];
int bvisit[101][101];
int dx[3] = { 1, 1, 0};
int dy[3] = { 0, 1, 1};
int dvisit[101][101];
int leveld, levelb;
int resultd, resultb;
int endx, endy;
queue<pair<int,int>> q;
void dfs(int h, int w){
    leveld++;
    if(h==endx && w==endy){
        resultd = leveld;
    }
    dvisit[h][w] = 1;
    for(int i=0;i<3;i++){
        int ww = w+dx[i];
        int hh = h+dy[i];
        if(arr[hh][ww]==1 && dvisit[hh][ww] == 0 && ww<=m && hh<=n) {
            dfs(hh,ww);
        }
    }
}

int main(){
    cin >> n >> m >> endx >> endy;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            cin >> arr[i][j];
        }
    }
    q.push(pair<int,int>(1,1));
    bvisit[1][1] = 1;
    while(!q.empty()){
            int h = q.front().first;
            int w = q.front().second;
            levelb++;
            //cout << h << " " << w << endl;
            if(h == endx && w== endy){
                resultb = levelb;
            }
            q.pop();
            for(int i=0;i<3;i++){
                int ww =w+dx[i];
                int hh = h+dy[i];
                if(arr[hh][ww]==1 && bvisit[hh][ww] == 0 && ww<=m && hh<=n){
                    bvisit[hh][ww] = 1;
                    q.push(pair<int,int>(hh,ww));
                }
            }
    }
    dfs(1,1);
    if(arr[endx][endy] == 0 ) {
        cout <<"NO";
        return 0;
    }
    if(resultb!=0){
        cout<< "YES\n";
        cout << resultd << " " << resultb;
    }
    else
        cout << "NO";
    return 0;
}
