#include <bits/stdc++.h>
using namespace std;
int n, m;
int n1, n2, n3;
const int MAXN = 5010;
vector<int> g[MAXN + 10];
vector<int> res[MAXN + 10];
int S[MAXN + 10], B[MAXN + 10];
bool C[MAXN + 10];
bool V[MAXN + 10];
bool ok;
int cc;
void dfs(int cur, int p = 0) {
  V[cur] = true;
  S[cc]++;
  B[cc] += !p;
  C[cur] = p;
  res[cc].push_back(cur);
  for (int nxt : g[cur]) {
    if (!V[nxt]) {
      dfs(nxt, 1 - p);
      S[cur] += S[nxt];
      B[cur] += B[nxt];
    } else if (C[nxt] == C[cur]) {
      ok = false;
      break;
    }
  }
}
int A[MAXN + 10];
bool mark[MAXN + 10][MAXN + 10];
bool memo[MAXN + 10][MAXN + 10];
short path[MAXN + 10][MAXN + 10];
char answer[MAXN + 10];
bool dp(int pos, int odd) {
  if (pos == cc) return odd == 0;
  bool& ans = memo[pos][odd];
  if (mark[pos][odd]) return ans;
  mark[pos][odd] = true;
  int r = n1 + n3 - odd;
  int e = ((pos == 0) ? 0 : A[pos - 1]) - r;
  int even = n2 - e;
  bool d1 = false, d2 = false;
  if (odd >= B[pos] && even >= S[pos] - B[pos]) d1 = dp(pos + 1, odd - B[pos]);
  if (odd >= S[pos] - B[pos] && even >= B[pos])
    d2 = dp(pos + 1, odd - S[pos] + B[pos]);
  if (d1)
    path[pos][odd] = 1;
  else if (d2)
    path[pos][odd] = 2;
  return ans = d1 || d2;
}
void trace(int pos, int odd) {
  if (pos == cc) return;
  int p = path[pos][odd];
  for (int x : res[pos]) {
    if ((C[x] == 0 && p == 1) || (C[x] == 1 && p == 2)) {
      if (n1) {
        answer[x - 1] = '1';
        n1--;
      } else {
        answer[x - 1] = '3';
        n3--;
      }
    } else
      answer[x - 1] = '2';
  }
  if (p == 1)
    trace(pos + 1, odd - B[pos]);
  else
    trace(pos + 1, odd - S[pos] + B[pos]);
}
int main() {
  scanf("%d %d", &n, &m);
  ok = true;
  scanf("%d %d %d", &n1, &n2, &n3);
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    g[x].push_back(y);
    g[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) {
    if (!V[i]) {
      dfs(i);
      cc++;
    }
  }
  if (!ok) {
    printf("NO\n");
    return 0;
  }
  A[0] = S[0];
  for (int i = 1; i < cc; i++) A[i] = A[i - 1] + S[i];
  bool ans = dp(0, n1 + n3);
  if (ans)
    trace(0, n1 + n3);
  else {
    printf("NO\n");
    return 0;
  }
  answer[n] = '\0';
  printf("YES\n%s\n", answer);
  return 0;
}
