#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<int> a(3);
  cin >> a[0] >> a[1] >> a[2];
  vector<vector<int>> g(n);
  for (int i = 0; i < m; ++i) {
    int u, v;
    cin >> u >> v;
    --u;
    --v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  vector<int> col(n);
  vector<array<vector<int>, 2>> cc;
  function<void(int, int)> dfs = [&](int u, int c) {
    col[u] = c;
    cc.back()[c - 1].push_back(u);
    for (int v : g[u]) {
      if (col[v] == c) {
        cout << "NO\n";
        exit(0);
      }
      if (!col[v]) dfs(v, (c == 1 ? 2 : 1));
    }
  };
  for (int i = 0; i < n; ++i) {
    if (!col[i]) {
      cc.emplace_back();
      dfs(i, 1);
    }
  }
  string ans(n, '2');
  vector<vector<bool>> dp(cc.size(), vector<bool>(n + 1));
  vector<vector<int>> par(cc.size(), vector<int>(n + 1));
  dp[0][cc[0][0].size()] = true;
  par[0][cc[0][0].size()] = 0;
  dp[0][cc[0][1].size()] = true;
  par[0][cc[0][1].size()] = 1;
  for (int i = 1; i < cc.size(); ++i) {
    int x = cc[i][0].size(), y = cc[i][1].size();
    for (int j = 0; j <= n; ++j)
      if (dp[i - 1][j]) {
        if (j + x <= n) {
          dp[i][j + x] = true;
          par[i][j + x] = 0;
        }
        if (j + y <= n) {
          dp[i][j + y] = true;
          par[i][j + y] = 1;
        }
      }
  }
  if (dp[(int)cc.size() - 1][a[1]] == false) {
    cout << "NO\n";
    return 0;
  }
  int I = (int)cc.size() - 1, J = a[1];
  while (I >= 0) {
    int p = par[I][J];
    for (auto u : cc[I][1 - p]) {
      if (a[0])
        ans[u] = '1', --a[0];
      else
        ans[u] = '3';
    }
    J -= cc[I][p].size();
    --I;
  }
  cout << "YES\n" << ans << '\n';
}
