#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
void solve() {}
int pos[12], a[1001], ct = 0;
int DP[1001][12][12];
int main() {
  memset(DP, -1, sizeof DP);
  memset(pos, 0, sizeof pos);
  int i, dif, un, ne;
  for (i = 1; i <= 10; i++) {
    char a;
    scanf(" %c", &a);
    pos[i] = a == '1';
  }
  int m;
  scanf("%d", &m);
  DP[0][0][0] = 0;
  for (i = 0; i < m; i++)
    for (dif = 0; dif <= 10; dif++)
      for (un = 0; un <= 10; un++)
        if (DP[i][dif][un] != -1)
          for (ne = 1; ne <= 10; ne++)
            if (pos[ne] && ne != un && dif - ne < 0)
              DP[i + 1][ne - dif][ne] = un;
  int fl = 0;
  for (dif = 0; dif <= 10; dif++) {
    for (un = 0; un <= 10; un++)
      if (DP[m][dif][un] != -1) {
        fl = 1;
        break;
      }
    if (fl) break;
  }
  if (fl) {
    printf("YES\n");
    int cr = un, cdi = dif;
    i = m;
    while (i) {
      a[ct++] = cr;
      ne = DP[i][cdi][cr];
      cdi = cr - cdi;
      cr = ne;
      i--;
    }
    for (i = m - 1; i >= 0; i--) printf("%d%c", a[i], (i ? ' ' : '\n'));
  } else
    printf("NO\n");
  return 0;
}
