#include <bits/stdc++.h>
using namespace std;
const int buf_size = 1e5 + 5;
char buf[buf_size], *S, *T;
inline char read_char() {
  if (S == T) T = (S = buf) + fread(buf, 1, buf_size, stdin);
  return S != T ? *(S++) : EOF;
}
inline int read_int() {
  int x = 0, f = 1;
  char c = read_char();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = read_char();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - 48, c = read_char();
  return x * f;
}
const int N = 5005;
int n, m, cnt;
int n1, n2, n3;
int belong[N];
bool c[N], vis[N], mark[N];
bool flag;
int a[N][2];
bool f[N][N], g[N][N];
vector<int> v[N];
void dfs(int x, int o) {
  a[o][c[x]]++;
  belong[x] = o;
  vis[x] = 1;
  for (int i = 0; i < v[x].size(); i++) {
    int y = v[x][i];
    if (!vis[y]) {
      c[y] = c[x] ^ 1;
      dfs(y, o);
    } else if (c[y] == c[x]) {
      flag = 1;
      return;
    }
  }
}
int main() {
  n = read_int(), m = read_int();
  n1 = read_int(), n2 = read_int(), n3 = read_int();
  for (int i = 1; i <= m; i++) {
    int x = read_int(), y = read_int();
    v[x].push_back(y);
    v[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) dfs(i, ++cnt);
  }
  if (flag) {
    cout << "NO";
    return 0;
  }
  f[0][0] = 1;
  for (int i = 1; i <= cnt; i++) {
    for (int j = a[i][0]; j <= n2; j++) {
      if (f[i - 1][j - a[i][0]]) f[i][j] = 1, g[i][j] = 0;
    }
    for (int j = a[i][1]; j <= n2; j++) {
      if (f[i - 1][j - a[i][1]]) f[i][j] = 1, g[i][j] = 1;
    }
  }
  if (!f[cnt][n2]) {
    cout << "NO";
    return 0;
  }
  cout << "YES\n";
  for (int i = cnt, j = n2; i >= 1; i--) {
    mark[i] = g[i][j];
    j -= a[i][g[i][j]];
  }
  for (int i = 1; i <= n; i++) {
    int j = belong[i];
    if (c[i] == mark[j])
      printf("2");
    else if (n1) {
      printf("1");
      n1--;
    } else
      printf("3");
  }
  return 0;
}
