#include <bits/stdc++.h>
const int MAX_N = (int)2e5 + 123;
const double eps = 1e-6;
const int inf = (int)1e9 + 123;
using namespace std;
int n, m;
vector<int> g[MAX_N], gr[MAX_N];
bool can[MAX_N], u[MAX_N];
int pr_n[MAX_N], pr_m[MAX_N], what[MAX_N];
bool kuhn(int v) {
  if (u[v]) return 0;
  u[v] = 1;
  for (auto to : g[v])
    if (can[abs(to)]) {
      pr_n[v] = abs(to), pr_m[abs(to)] = v;
      what[abs(to)] = to;
      return 1;
    }
  for (auto to : g[v])
    if (!pr_m[abs(to)] || kuhn(pr_m[abs(to)])) {
      pr_n[v] = abs(to), pr_m[abs(to)] = v;
      what[abs(to)] = to;
      return 1;
    }
  return 0;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1, k, x; i <= n; i++) {
    scanf("%d", &k);
    while (k--) {
      scanf("%d", &x);
      g[i].push_back(x);
      gr[abs(x)].push_back(x);
    }
  }
  for (int i = 1; i <= m; i++)
    if (int((gr[i]).size()) < 2 || gr[i][0] == gr[i][1]) can[i] = 1;
  while (1) {
    bool ok = 0;
    memset(u, 0, sizeof u);
    for (int i = 1; i <= n; i++)
      if (!pr_n[i] && kuhn(i)) ok = 1;
    if (!ok) break;
  }
  for (int i = 1; i <= n; i++)
    if (!pr_n[i]) {
      printf("NO\n");
      return 0;
    }
  printf("YES\n");
  for (int i = 1; i <= m; i++) printf("%d", (what[i] > 0));
  return 0;
}
