#include<iostream>
#include<cstdio>
#include<algorithm>
#include<queue>
#include<cassert>
using namespace std;

#define INF (1<<30)
#define MAX 1000
 
class Edge{
public:
  int to, rev, cap, flow;
  Edge(int to=0, int rev=0, int cap=0, int flow=0):to(to), rev(rev), cap(cap), flow(flow){}
};
 
int V;
vector<Edge> G[MAX];

int N;
int P[MAX][MAX];
 
void connect( int source, int target, int cap ){
  G[source].push_back(Edge(target, G[target].size(), cap, 0));
  G[target].push_back(Edge(source, G[source].size()-1, 0, 0));
}
 
bool bfs(pair<int, int> pi[], int source, int target ){
  bool visited[MAX];
  queue<int> Q;
   
  for ( int i = 0; i < V; i++ ) {
    visited[i] = false;
    pi[i] = make_pair(-1, -1);
  }
   
  int u, v;
  Q.push( source );
  visited[source] = true;
   
  while( !Q.empty() ){
    u = Q.front(); Q.pop();
    if ( u == target ) return true;
    for( int i = 0; i < G[u].size(); i++ ){
      int v = G[u][i].to;
      if ( visited[v] ) continue;
      if ( G[u][i].cap > G[u][i].flow ){
	pi[v] = make_pair(u, i);
	visited[v] = true;
	Q.push(v);
      }
    }
  }
  return false;
}
 
int edmonds_karp(int source, int target ){
  int flow;
  pair<int, int> pi[MAX]; //pre, to index
 
  while ( bfs(pi, source, target ) ){
    flow = INF;
    for ( int v = target; v != source; v = pi[v].first ){
      int u = pi[v].first;
      int idx = pi[v].second;
      flow = min(flow, G[u][idx].cap - G[u][idx].flow);
    }
    for ( int v = target; v != source; v = pi[v].first ){
      int u = pi[v].first;
      int idx = pi[v].second;
      int rev = G[u][idx].rev;
      G[u][idx].flow += flow;
      G[v][rev].flow = -G[u][idx].flow;
    }
  }
 
  flow = 0;
  for ( int i = 0; i < G[source].size(); i++ )  flow += G[source][i].flow;
   
  return flow;
}


void solve(){
  for ( int i = 0; i < V; i++ ) G[i].clear();

  for ( int i = 0; i < N; i++ ){
    connect(0, i+1, 1);
  }
  for ( int i = 0; i < N; i++ ){
    for ( int j = 0; j < N; j++ ){
      if ( P[j][i] == 1 ){
	connect(i+1, N+1+j, P[j][i]);
      }
    }
  }
  for ( int i = 0; i < N; i++ ){
    connect(N+1+i, V-1, 1);
  }

  int f = edmonds_karp(0, V - 1);
  if ( f != N ){
    cout << "no" << endl; return;
  }
  cout << "yes" << endl;

  pair<int, int> pi[MAX]; //pre, to index

  for ( int i = 1; i <= N; i++ ){
    //for ( int j = N-1; j >= 0; j-- ){
    for ( int j = G[i].size()-1; j >= 1; j-- ){ // j = 0, rev of i
      //      int s = i+1;
      //      int t = j+N+1;
      int s = i;
      int t = G[i][j].to;
      if ( G[s][j].flow == 0 ) {
	G[s][j].cap = 0;
	// not use
      } else {
	assert(G[s][j].flow == 1 );
	G[s][j].cap = 0;
	G[s][j].flow = 0;
	G[G[s][j].to][G[s][j].rev] = 0;
	if ( bfs(pi, s, t) ){
	  int flow = 1;
	  for ( int v = t; v != s; v = pi[v].first ){
	    int u = pi[v].first;
	    int idx = pi[v].second;
	    int rev = G[u][idx].rev;
	    G[u][idx].flow += flow;
	    G[v][rev].flow = -G[u][idx].flow;
	  }
	  // not use
	} else {
	  G[s][j].cap = 1;
	  G[s][j].flow = 1;
	  G[G[s][j].to][G[s][j].rev] = -1;
	  cout << t-N << endl;
	  // use
	}
      }
    }
  }
}

int main(){
  //  cin >> N;
  scanf("%d", &N);
  N--;
  V = 2*N + 2;
  for ( int i = 0; i < N; i++ ){
    for ( int j = 0; j < N; j++ ){
      //      cin >> P[i][j];      
      scanf("%d", &P[i][j]);

    }
  }
  solve();
}

Measured memory_bytes: 5492