public void solve() throws IOException {
    int n = nextInt();
    while (n != 0) {
      boolean[] hit = new boolean[49];
      for (int x = 0; x < n; x++) {
        for (int y = 0; y < 6; y++) {
          hit[nextInt() - 1] = true;
        }
      }
      boolean hitall = true;
      for (int x = 0; x < 49; x++) {
        hitall &= hit[x];
      }
      if (hitall) {
        System.out.println("Yes");
      } else {
        System.out.println("No");
      }
      n = nextInt();
    }
  }