#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3f;
const int MOD = 1e9 + 7;
int dir[8][2] = {-1, 0, 1, 0, 0, -1, 0, 1, -1, -1, -1, 1, 1, -1, 1, 1};
template <typename S, typename T>
ostream &operator<<(ostream &os, const pair<S, T> x) {
  os << "(" << x.first << ", " << x.second << ")";
  return os;
}
template <typename S, typename T>
inline bool Min(S &a, const T &b) {
  return a > b ? a = b, true : false;
}
template <typename S, typename T>
inline bool Max(S &a, const T &b) {
  return a < b ? a = b, true : false;
}
template <typename S, typename T>
inline void Adm(S &a, const T &b) {
  a = (a + b) % MOD;
  if (a < 0) a += MOD;
}
template <typename T>
inline bool IsPri(T x) {
  if (x < 2) return false;
  for (T i = 2; i * i <= x; ++i)
    if (x % i == 0) return false;
  return true;
}
template <typename T>
inline T _Gcd(T a, T b) {
  while (b) {
    T t = b;
    b = a % b;
    a = t;
  }
  return a;
}
template <typename T>
inline int _BitCnt(T x) {
  int cnt = 0;
  while (x) ++cnt, x &= x - 1;
  return cnt;
}
inline long long Pow(long long a, long long n) {
  long long t = 1;
  a %= MOD;
  while (n > 0) {
    if (n & 1) t = t * a % MOD;
    a = a * a % MOD, n >>= 1;
  }
  return t % MOD;
}
inline int read() {
  static char buf[1000000], *p1 = buf, *p2 = buf;
  register int x = false;
  register char ch =
      p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2)
          ? EOF
          : *p1++;
  ;
  register bool sgn = false;
  while (ch != '-' && (ch < '0' || ch > '9'))
    ch = p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2)
             ? EOF
             : *p1++;
  ;
  if (ch == '-')
    sgn = true,
    ch = p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2)
             ? EOF
             : *p1++;
  ;
  while (ch >= '0' && ch <= '9')
    x = (x << 1) + (x << 3) + (ch ^ 48),
    ch = p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2)
             ? EOF
             : *p1++;
  ;
  return sgn ? -x : x;
}
const int N = 5e3 + 100;
vector<int> e[N];
int col[N], idx;
vector<int> v[N][2];
bool DYE(int x, int c) {
  col[x] = c, v[idx][c].push_back(x);
  for (int y : e[x])
    if (col[y] == -1 && !DYE(y, !c) || col[y] == c) puts("NO"), exit(0);
  return true;
}
int f[N][N];
int ans[N];
int main() {
  int n, m, a, b, c;
  cin >> n >> m >> a >> b >> c;
  for (int i = 1; i <= m; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    e[u].push_back(v), e[v].push_back(u);
  }
  memset((col), (-1), sizeof(col)), memset((f), (-1), sizeof(f)), f[0][0] = 0;
  for (int i = 1; i <= n; ++i)
    if (col[i] == -1) {
      ++idx, DYE(i, 0);
      for (int j = b; j >= 0; --j)
        for (int k = 0; k < 2; ++k)
          if (((int)(v[idx][k]).size()) <= j) {
            int l = j - ((int)(v[idx][k]).size());
            if (f[idx - 1][l] != -1) f[idx][j] = k;
          }
    }
  if (f[idx][b] == -1) puts("NO"), exit(0);
  puts("YES");
  for (int i = idx; i >= 1; --i) {
    for (int x : v[i][f[i][b]]) ans[x] = 2;
    b -= ((int)(v[i][f[i][b]]).size());
  }
  for (int i = 1; i <= n; ++i) printf("%d", ans[i] == 2 ? 2 : (a ? --a, 1 : 3));
  puts("");
  return 0;
}
