#include <bits/stdc++.h>
using namespace std;
const int N = 5000 + 1;
int n, m;
int n1, n2, n3;
vector<int> g[N];
int col[N];
int cnt[3];
void dfs(int v) {
  ++cnt[col[v]];
  for (int u : g[v]) {
    if (col[u] == col[v]) {
      cout << "NO\n";
      exit(0);
    }
    if (col[u] == 3 - col[v]) continue;
    col[u] = 3 - col[v];
    dfs(u);
  }
}
int dp[N][N];
int ans[N];
int solve(int v, int c) {
  int res = 0;
  if (col[v] == c) {
    ++res;
    ans[v] = 2;
  } else if (n1) {
    ans[v] = 1;
    --n1;
  } else
    ans[v] = 3;
  for (int u : g[v])
    if (!ans[u]) res += solve(u, c);
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  cin >> n >> m;
  cin >> n1 >> n2 >> n3;
  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> comps;
  int j = 0;
  dp[0][0] = 1;
  for (int i = 0; i < n; ++i)
    if (!col[i]) {
      comps.push_back(i);
      col[i] = 1;
      cnt[1] = 0;
      cnt[2] = 0;
      dfs(i);
      ++j;
      for (int i = 0; i <= n; ++i) {
        if (i >= cnt[1] && dp[j - 1][i - cnt[1]])
          dp[j][i] = 1;
        else if (i >= cnt[2] && dp[j - 1][i - cnt[2]])
          dp[j][i] = 2;
      }
    }
  if (!dp[j][n2]) {
    cout << "NO\n";
    return 0;
  }
  int k = n2;
  for (; j > 0; --j) k -= solve(comps[j - 1], dp[j][k]);
  cout << "YES\n";
  for (int i = 0; i < n; ++i) cout << ans[i];
  cout << '\n';
}
