#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int t, n, m, n1, n2, n3, conn = 0, vis[5005] = {0}, cnt[5005][3] = {0}, c1 = 0,
                         c0 = 0, dp[5005][5005][2] = {0}, type[5005] = {0};
vector<int> v[5005], v1;
int ans[50005] = {0}, tt = 0;
void dfs(int x) {
  if (type[x] == 0)
    c0++;
  else
    c1++;
  vis[x] = 1;
  for (int i = 0; i < v[x].size(); i++) {
    if (vis[v[x][i]] && type[v[x][i]] == type[x]) {
      cout << "NO";
      exit(0);
    }
    if (!vis[v[x][i]]) {
      type[v[x][i]] = 1 - type[x];
      dfs(v[x][i]);
    }
  }
}
void dfs2(int x, int gg) {
  vis[x] = 1;
  if (gg == tt) ans[x] = 2;
  for (int i = 0; i < v[x].size(); i++) {
    if (!vis[v[x][i]]) dfs2(v[x][i], 1 - gg);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int i, j, k, x, y;
  cin >> n >> m >> n1 >> n2 >> n3;
  for (i = 1; i <= m; i++) {
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  for (i = 1; i <= n; i++) {
    if (!vis[i]) {
      conn++;
      c1 = c0 = 0;
      type[i] = 0;
      dfs(i);
      cnt[conn][0] = c0;
      cnt[conn][1] = c1;
    }
  }
  memset(dp, -1, sizeof dp);
  dp[1][cnt[1][0]][0] = 0;
  dp[1][cnt[1][1]][1] = 1;
  for (i = 2; i <= conn; i++) {
    for (j = 0; j < 5005; j++) {
      for (k = 0; k < 2; k++) {
        if (j + cnt[i][k] > 5004) continue;
        if (dp[i - 1][j][0] != -1) dp[i][j + cnt[i][k]][k] = 0;
        if (dp[i - 1][j][1] != -1) dp[i][j + cnt[i][k]][k] = 1;
      }
    }
  }
  int cc = -1;
  if (dp[conn][n2][0] != -1) cc = 0;
  if (dp[conn][n2][1] != -1) cc = 1;
  if (cc == -1) {
    cout << "NO";
    return 0;
  }
  x = n2;
  for (j = conn; j >= 1; j--) {
    v1.push_back(cc);
    y = cnt[j][cc];
    cc = dp[j][x][cc];
    x -= y;
  }
  reverse(v1.begin(), v1.end());
  memset(vis, 0, sizeof vis);
  memset(type, 0, sizeof type);
  j = 0;
  for (i = 1; i <= n; i++) {
    if (!vis[i]) {
      tt = v1[j];
      j++;
      dfs2(i, 0);
    }
  }
  cout << "YES\n";
  for (i = 1; i <= n; i++) {
    if (!ans[i]) {
      if (n1) {
        cout << "1";
        n1--;
      } else
        cout << "3";
    } else
      cout << ans[i];
  }
  return 0;
}
