#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  int n1, n2, n3;
  cin >> n1 >> n2 >> n3;
  vector<vector<int>> adjList(n + 1);
  vector<pair<int, int>> v_comp_col(n + 1, {-1, 0});
  vector<vector<int>> dp(1, vector<int>(5001, -1));
  vector<pair<int, int>> comp_sizes;
  for (auto i = 0; i < m; ++i) {
    int u, v;
    cin >> u >> v;
    adjList[u].push_back(v);
    adjList[v].push_back(u);
  }
  int components = 0;
  for (auto i = 1; i < n + 1; i++) {
    if (v_comp_col[i].first >= 0) continue;
    stack<int> s;
    v_comp_col[i].second = -1;
    s.push(i);
    int l = 0, r = 0;
    while (s.size() != 0) {
      int last = s.top();
      s.pop();
      if (v_comp_col[last].first >= 0) continue;
      v_comp_col[last].first = components;
      if (v_comp_col[last].second == -1)
        l++;
      else
        r++;
      for (auto n : adjList[last]) {
        if (v_comp_col[n].second * v_comp_col[last].second > 0) {
          cout << "NO"
               << "\n";
          return 0;
        } else if (v_comp_col[n].first < 0) {
          s.push(n);
          v_comp_col[n].second = -1 * v_comp_col[last].second;
        }
      }
    }
    comp_sizes.push_back({l, r});
    if (components == 0) {
      if (r > 5000) cout << "error" << endl;
      if (l > 5000) cout << "error" << endl;
      dp[components][l] = 0;
      dp[components][r] = 1;
    } else {
      dp.push_back(vector<int>(5001, -1));
      for (auto dp_i = 0; dp_i < dp[components - 1].size(); ++dp_i) {
        if (dp[components - 1][dp_i] >= 0) {
          if (dp_i + r < 5001) dp[components][dp_i + r] = 1;
          if (dp_i + l < 5001) dp[components][dp_i + l] = 0;
        }
      }
    }
    components++;
  }
  if (dp[components - 1][n2] >= 0)
    cout << "YES"
         << "\n";
  else {
    cout << "NO"
         << "\n";
    return 0;
  }
  vector<int> colors(components);
  int iter = n2;
  for (int i = components - 1; i >= 0; --i) {
    if (dp[i][iter] == 0)
      colors[i] = 1;
    else
      colors[i] = -1;
    if (i > 0) {
      if (dp[i][iter] == 0 && dp[i - 1][iter - comp_sizes[i].first] >= 0)
        iter -= comp_sizes[i].first;
      else
        iter -= comp_sizes[i].second;
    }
  }
  int n1_counter = 0;
  for (auto i = 1; i <= n; ++i) {
    if (v_comp_col[i].second * colors[v_comp_col[i].first] < 0)
      cout << "2";
    else if (n1_counter < n1) {
      cout << "1";
      n1_counter++;
    } else {
      cout << "3";
    }
  }
  cout << endl;
  return 0;
}
