#include <bits/stdc++.h>
using namespace std;
vector<int> G[5010];
int col[5010];
int ss[5050];
int n, m, n1, n2, n3;
int nowp = 0;
int x, y;
bool is_bi(int u) {
  ss[u] = nowp;
  for (int i = 0; i < G[u].size(); i++) {
    int v = G[u][i];
    ss[v] = nowp;
    if (col[v] == col[u]) return false;
    if (!col[v]) {
      col[v] = 3 - col[u];
      if (col[v] == 1)
        x++;
      else
        y++;
      if (!is_bi(v)) return false;
    }
  }
  return true;
}
int w[10010], v[10010];
int dp[5050][5050];
int item[5010];
int main() {
  cin >> n >> m >> n1 >> n2 >> n3;
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    if (!col[i]) {
      nowp++;
      x = 1, y = 0;
      col[i] = 1;
      bool fg = is_bi(i);
      if (!fg) {
        puts("NO");
        return 0;
      }
      w[nowp] = x;
      v[nowp] = y;
    }
  }
  dp[0][0] = 3;
  for (int i = 0; i < nowp; i++) {
    for (int j = 0; j <= n1 + n2 + n3; j++) {
      if (dp[i][j] != 0) {
        dp[i + 1][j + w[i + 1]] = 1;
        dp[i + 1][j + v[i + 1]] = 2;
      }
    }
  }
  int now = n2;
  if (dp[nowp][n2] == 0)
    puts("NO");
  else {
    puts("YES");
    for (int i = n; i; i--) {
      if (dp[i][now] == 2) {
        item[i] = 2;
        now -= v[i];
      } else {
        item[i] = 1;
        now -= w[i];
      }
    }
    for (int i = 1; i <= n; i++) {
      int noc = item[ss[i]];
      if ((noc == 2 && col[i] == 1) || (noc == 1 && col[i] == 2)) {
        if (n1)
          n1--, putchar('1');
        else
          putchar('3');
      } else
        putchar('2');
    }
    puts("");
  }
}
