#include <bits/stdc++.h>
using namespace std;
char a[11];
vector<int> ans;
bool dfs(int left, int right, int prev, int m, int curr) {
  if (m == curr) {
    return true;
  }
  if (curr % 2 == 0) {
    bool check = false;
    for (int i = 1; i <= 10; i++) {
      if (a[i] == '1' && i != prev) {
        if (left + i > right) {
          if (dfs(left + i, right, i, m, curr + 1)) {
            ans.push_back(i);
            return true;
          }
        }
      }
    }
    return false;
  }
  if (curr % 2 == 1) {
    bool check = false;
    for (int i = 1; i <= 10; i++) {
      if (a[i] == '1' && i != prev) {
        if (right + i > left) {
          if (dfs(left, right + i, i, m, curr + 1)) {
            ans.push_back(i);
            return true;
          }
        }
      }
    }
    return false;
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  for (int i = 1; i <= 10; i++) cin >> a[i];
  int m;
  cin >> m;
  if (dfs(0, 0, 0, m, 0)) {
    cout << "YES" << endl;
    for (int i = ans.size() - 1; i >= 0; i--) {
      cout << ans[i] << " ";
    }
  } else {
    cout << "NO";
  }
  return 0;
}
