#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
vector<int> adj[maxn][2];
vector<int> G[maxn], id[maxn];
char ans[maxn];
bool ok[maxn];
int n, m;
queue<int> q;
void bfs() {
  while (q.size()) {
    int u = q.front();
    q.pop();
    for (int i = 0, M = G[u].size(); i < M; i++) {
      int v = G[u][i];
      if (ok[v]) continue;
      ok[v] = true;
      q.push(v);
      int var = id[u][i];
      ans[var] = (v == adj[var][1][0]) + '0';
    }
  }
}
bool vis[maxn];
bool dfs(int u, int pvar) {
  if (vis[u]) return true;
  vis[u] = true;
  for (int i = 0, M = G[u].size(); i < M; i++) {
    int v = G[u][i];
    int var = id[u][i];
    if (var == pvar) continue;
    if (dfs(v, var)) {
      ok[u] = true;
      q.push(u);
      ans[var] = (u == adj[var][1][0]) + '0';
      return true;
    }
  }
  return false;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    int k;
    scanf("%d", &k);
    int v;
    while (k--) {
      scanf("%d", &v);
      int fg = v;
      if (v < 0) v = -v;
      adj[--v][fg > 0].push_back(i);
    }
  }
  for (int i = 0; i < m; i++) {
    if (adj[i][0].empty()) {
      for (int j = 0, M = adj[i][1].size(); j < M; j++) {
        ok[adj[i][1][j]] = true;
        q.push(adj[i][1][j]);
      }
      ans[i] = '1';
    } else if (adj[i][1].empty()) {
      for (int j = 0, M = adj[i][0].size(); j < M; j++) {
        ok[adj[i][0][j]] = true;
        q.push(adj[i][0][j]);
      }
      ans[i] = '0';
    } else {
      int u = adj[i][0][0], v = adj[i][1][0];
      G[u].push_back(v);
      id[u].push_back(i);
      G[v].push_back(u);
      id[v].push_back(i);
    }
  }
  for (int i = 0; i < n; i++) {
    bfs();
    if (ok[i]) continue;
    if (!dfs(i, -1)) {
      puts("NO");
      return 0;
    }
  }
  puts("YES");
  for (int i = 0; i < m; i++) {
    if (ans[i])
      putchar(ans[i]);
    else
      putchar('0');
  }
  return 0;
}
