#include <bits/stdc++.h>
using namespace std;
template <class T>
void _R(T &x) {
  cin >> x;
}
void _R(int &x) { scanf("%d", &x); }
void _R(long long &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf("%c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template <class T, class... U>
void R(T &head, U &...tail) {
  _R(head);
  R(tail...);
}
template <class T>
void _W(const T &x) {
  cout << x;
}
void _W(const int &x) { printf("%d", x); }
void _W(const long long &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template <class T, class U>
void _W(const pair<T, U> &x) {
  _W(x.F);
  putchar(' ');
  _W(x.S);
}
template <class T>
void _W(const vector<T> &x) {
  for (auto i = x.begin(); i != x.end(); _W(*i++))
    if (i != x.cbegin()) putchar(' ');
}
void W() {}
template <class T, class... U>
void W(const T &head, const U &...tail) {
  _W(head);
  putchar(sizeof...(tail) ? ' ' : '\n');
  W(tail...);
}
int n, m, n1, n2, n3;
vector<int> g[5005];
int yes, tot;
int vis[5005], cnt[5005], ct[5005], cf[5005], cd[5005], us[5005], ans[5005];
int flag[5005];
int dp[5005];
void dfs(int u, int p) {
  vis[u] = tot;
  if (flag[u]) {
    if (p && flag[u] == flag[p]) yes = 0;
    return;
  } else if (p == 0)
    flag[u] = 1;
  else
    flag[u] = 3 - flag[p];
  if (flag[u] == 1) cnt[tot]++;
  ct[tot]++;
  for (int v : g[u]) {
    if (v == p) continue;
    dfs(v, u);
    if (yes == 0) return;
  }
}
int main() {
  yes = 1;
  R(n, m);
  R(n1, n2, n3);
  for (int i = 1, u, v; i <= m; ++i) {
    R(u, v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (int i = 1; i <= n && yes; ++i) {
    if (vis[i] == 0) {
      ++tot;
      dfs(i, 0);
    }
  }
  if (yes == 0) {
    W("NO");
    return 0;
  }
  for (int i = 1; i <= tot; ++i) {
    if (ct[i] - cnt[i] > cnt[i]) {
      n2 -= cnt[i];
      cd[i] = ct[i] - cnt[i] * 2;
    } else {
      n2 -= (ct[i] - cnt[i]);
      cf[i] = 1;
      cd[i] = cnt[i] * 2 - ct[i];
    }
  }
  if (n2 < 0) {
    W("NO");
    return 0;
  }
  dp[0] = 1;
  for (int i = 1; i <= tot; ++i) {
    for (int j = n2; j >= cd[i]; --j) {
      if (dp[j - cd[i]] && dp[j] == 0) dp[j] = i;
    }
  }
  if (dp[n2] == 0) {
    W("NO");
    return 0;
  }
  while (n2) {
    us[dp[n2]] = cf[dp[n2]] == 1 ? 1 : 2;
    n2 -= cd[dp[n2]];
  }
  for (int i = 1; i <= tot; ++i) {
    if (us[i] == 0) us[i] = 1 + cf[i];
  }
  for (int i = 1; i <= n; ++i) {
    if (flag[i] == us[vis[i]]) {
      ans[i] = 2;
    } else if (n1) {
      ans[i] = 1;
      n1--;
    } else
      ans[i] = 3;
  }
  W("YES");
  for (int i = 1; i <= n; ++i) printf("%d", ans[i]);
  puts("");
  return 0;
}
