#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 100;
vector<int> w[N], dis[N];
int val[N];
queue<int> q;
bool solved[N];
int cnt[N];
int sign(int x) {
  if (x == 0) return 0;
  return x > 0 ? 1 : -1;
}
void NO() {
  printf("NO");
  exit(0);
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &cnt[i]);
    int x;
    for (int j = 0; j < cnt[i]; j++) {
      scanf("%d", &x);
      w[abs(x)].push_back(i * sign(x));
      dis[i].push_back(x);
    }
    if (cnt[i] == 1) q.push(i);
  }
  int ptr = 1;
  while (ptr <= n) {
    if (q.empty()) {
      while (ptr <= n && solved[ptr]) ptr++;
      if (ptr == n + 1) break;
      q.push(ptr);
    }
    int idx = q.front();
    q.pop();
    if (solved[idx]) continue;
    int fix = 0;
    for (int x : dis[idx]) {
      if (val[abs(x)] == 0) {
        fix = x;
        break;
      }
    }
    if (fix == 0) NO();
    val[abs(fix)] = sign(fix);
    for (int d : w[abs(fix)])
      if (d * sign(fix) > 0)
        solved[abs(d)] = true;
      else {
        if (cnt[abs(d)]-- == 2) q.push(abs(d));
      }
  }
  printf("YES\n");
  for (int i = 1; i <= m; i++) {
    printf("%d", (val[i] == 1 ? 1 : 0));
  }
}
