#include <bits/stdc++.h>
using namespace std;
long long n, m, n1, n2, n3, icount, dp[5001][5001], co[5001], ans[5001],
    c[5001], cnt;
vector<long long> g[5001], bl[5001], wh[5001];
void dfs(long long u) {
  if (co[u] == 1)
    wh[icount].push_back(u);
  else
    bl[icount].push_back(u);
  for (long long i = 0; i < g[u].size(); i++) {
    long long v = g[u][i];
    if (!co[v]) {
      co[v] = (co[u] == 1) ? 2 : 1;
      dfs(v);
    } else if (co[v] == co[u]) {
      cout << "NO" << '\n';
      exit(0);
    }
  }
}
int main() {
  cin >> n >> m;
  cin >> n1 >> n2 >> n3;
  dp[0][0] = 1;
  for (long long i = 1; i <= m; i++) {
    long long u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (long long i = 1; i <= n; i++) {
    if (!co[i]) {
      icount++;
      co[i] = 1;
      dfs(i);
    }
  }
  for (long long i = 1; i <= icount; i++) {
    for (long long j = 0; j <= n; j++) {
      if (bl[i].size() <= j) dp[i][j] |= dp[i - 1][j - bl[i].size()];
      if (wh[i].size() <= j) dp[i][j] |= dp[i - 1][j - wh[i].size()];
    }
  }
  if (dp[icount][n2])
    cout << "YES" << endl;
  else {
    cout << "NO" << endl;
    return 0;
  }
  long long sum = n2;
  for (long long i = icount; i >= 1; i--) {
    if (dp[i - 1][sum - bl[i].size()]) {
      c[i] = 1;
      sum -= bl[i].size();
    } else if (dp[i - 1][sum - wh[i].size()]) {
      c[i] = 2;
      sum -= wh[i].size();
    }
  }
  for (long long i = 1; i <= icount; i++) {
    if (c[i] == 1) {
      for (long long j = 0; j < bl[i].size(); j++) ans[bl[i][j]] = 2;
    } else {
      for (long long j = 0; j < wh[i].size(); j++) ans[wh[i][j]] = 2;
    }
  }
  for (long long i = 1; i <= n; i++) {
    if (!ans[i]) {
      if (cnt < n1)
        ans[i] = 1, cnt++;
      else
        ans[i] = 3;
    }
  }
  for (long long i = 1; i <= n; i++) cout << ans[i];
  cout << endl;
  return 0;
}
