#include <bits/stdc++.h>
using namespace std;
int R[200005], in[200005];
vector<int> V[200005];
bool B[200005];
queue<int> Q;
vector<int> W[200005];
bool erase(int v) {
  bool boo = 0;
  for (int i = 0; i < (int)W[v].size(); i++) {
    if (W[v][i] > 0 && R[W[v][i]] == 1 || W[v][i] < 0 && R[W[v][i]] == 2)
      boo = 1;
    int qwe = abs(W[v][i]);
    if (R[abs(W[v][i])] == 0) {
      boo = 1;
      if (W[v][i] > 0)
        R[abs(W[v][i])] = 1;
      else
        R[abs(W[v][i])] = 2;
      in[abs(V[qwe][0])]--;
      in[abs(V[qwe][1])]--;
      if (in[abs(V[qwe][0])] == 1) Q.push(abs(V[qwe][0]));
      if (in[abs(V[qwe][1])] == 1) Q.push(abs(V[qwe][1]));
      break;
    }
  }
  return boo;
}
int main() {
  int n, k, a, b;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a);
    for (int j = 0; j < a; j++) {
      scanf("%d", &b);
      W[i].push_back(b);
      if (b < 0)
        V[-b].push_back(-i);
      else
        V[b].push_back(i);
    }
    in[i] = a;
  }
  for (int i = 1; i <= k; i++) {
    if (V[i].size() == 0) R[i] = 1;
    if (V[i].size() == 1) {
      B[abs(V[i][0])] = 1;
      if (V[i][0] > 0)
        R[i] = 1;
      else
        R[i] = 2;
    }
    if (V[i].size() == 2 && (long long)V[i][0] * (long long)V[i][1] > 0) {
      B[abs(V[i][0])] = 1;
      B[abs(V[i][1])] = 1;
      if (V[i][0] > 0)
        R[i] = 1;
      else
        R[i] = 2;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (!B[i] && in[i] == 1) Q.push(i);
  }
  for (int i = 1; i <= n; i++) {
    while (!Q.empty()) {
      int v = Q.front();
      Q.pop();
      if (B[v] == 1) continue;
      if (!erase(v)) {
        printf("NO\n");
        return 0;
      } else
        B[v] = 1;
    }
    if (!B[i]) {
      if (!erase(i)) {
        printf("NO\n");
        return 0;
      } else
        B[i] = 1;
    }
  }
  printf("YES\n");
  for (int i = 1; i <= k; i++) {
    if (R[i] < 2)
      printf("1");
    else
      printf("0");
  }
  printf("\n");
  return 0;
}
