#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;

const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, 1, -1};

int H, W, sum;

bool dfs(int x, int y, int sx, int sy, int cnt, vector< vector<int> > &degs, vector< vector<int> > &board) {
    if(false) {
        fprintf(stderr, "x = %d, y = %d, cnt = %d\n", x, y, cnt);
        for(int i=0; i<H; i++) {
            for(int j=0; j<W; j++) {
                if(i == x and j == y) fprintf(stderr, "* ");
                else fprintf(stderr, "%d ", board[i][j]);
            }
            fprintf(stderr, "\n");
        }
    }
    
    if(x == sx and y == sy) {
        if(cnt != sum) return cnt == 0;
    }
    else if(cnt == 0) return false;
    
    for(int k=0; k<4; k++) {
        int nx = x + dx[k], ny = y + dy[k];
        if(nx < 0 or nx >= H or ny < 0 or ny >= W) continue;
        if(board[nx][ny] == 1) continue;
        for(int i=0; i<4; i++) {
            int gx = nx + dx[i], gy = ny + dy[i];
            if(gx < 0 or gx >= H or gy < 0 or gy >= W) continue;
            if(board[gx][gy] == 1) continue;
            degs[gx][gy]--;
        }

        bool ok = true;
        for(int i=0; i<H; i++) {
            for(int j=0; j<W; j++) {
                if(board[i][j] == 1) continue;
                {
                    int d = abs(sx - i) + abs(sy - j);
                    if(d <= 1) continue;
                }

                {
                    int d = abs(nx - i) + abs(ny - j);
                    if(d <= 1) continue;
                }

                if(degs[i][j] <= 1) {
                    // fprintf(stderr, "[x = %d, y = %d, nx = %d, ny = %d] false: i = %d, j = %d\n", x, y, nx, ny, i, j);
                    ok = false;
                    i = H, j = W;
                }
            }
        }

        if(ok) {
            board[nx][ny] = 1;
            bool b = dfs(nx, ny, sx, sy, cnt - 1, degs, board);
            board[nx][ny] = 0;
            if(b) return true;
        }

        for(int i=0; i<4; i++) {
            int gx = nx + dx[i], gy = ny + dy[i];
            if(gx < 0 or gx >= H or gy < 0 or gy >= W) continue;
            if(board[gx][gy] == 1) continue;
            degs[gx][gy]++;
        }
    }
    return false;
}

int solve_testcase() {
    cin >> W >> H;
    if(W == 0 and H == 0) return 1;
    
    vector< vector<int> > board(H, vector<int>(W));
    vector< vector<int> > degs(H, vector<int>(W));
    
    int cnt = 0, deg0 = 0, deg1 = 0, sx = -1, sy = -1;
    for(int i=0; i<H; i++) {
        for(int j=0; j<W; j++) {
            cin >> board[i][j];
            if(board[i][j] == 0) {
                cnt++;
                sx = i, sy = j;
            }
        }
    }
    for(int i=0; i<H; i++) {
        for(int j=0; j<W; j++) {
            if(board[i][j] == 1) continue;
            int deg = 0;
            for(int k=0; k<4; k++) {
                int x = i + dx[k], y = j + dy[k];
                if(x < 0 or x >= H or y < 0 or y >= W) continue;
                if(board[x][y] == 1) continue;
                deg++;
            }
            degs[i][j] = deg;

            if(deg == 0) deg0++;
            if(deg == 1) deg1++;
        }
    }

    sum = cnt;
    bool ok = true;
    // ok &= (deg0 == 0 and deg1 == 0);
    // ok &= (cnt > 0 and cnt % 2 == 0);
    cout << (ok && dfs(sx, sy, sx, sy, cnt, degs, board) ? "Yes" : "No") << endl;
    return 0;
}

int main() {
    while(!solve_testcase());
    return 0;
}



Measured memory_bytes: 3052