#include <bits/stdc++.h>
using namespace std;
const int N = 5e3 + 10;
const long long mod = 998244353;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - 48;
    ch = getchar();
  }
  return x * f;
}
long long n, tot;
int v[N];
int dp[N][5], f[N], vis[N], bl[N], p[N];
int pt[N][N];
vector<int> e[N];
void dfs(int x, int val) {
  bl[x] = tot;
  v[x] = val;
  vis[x] = 1;
  dp[tot][val]++;
  val = 3 - val;
  for (int i = 0; i < e[x].size(); i++) {
    int nxt = e[x][i];
    if (!vis[nxt]) {
      dfs(nxt, val);
    } else {
      if (v[nxt] == v[x]) {
        cout << "NO" << endl;
        exit(0);
      }
    }
  }
}
void dfs1(int x, int val) {
  v[x] = val;
  vis[x] = 1;
  val = 3 - val;
  for (int i : e[x]) {
    if (!vis[i]) dfs1(i, val);
  }
}
int main() {
  long long k, q, _;
  long long m;
  cin >> n >> m;
  int n1, n2, n3;
  cin >> n1 >> n2 >> n3;
  int x, y;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    x--, y--;
    e[x].push_back(y);
    e[y].push_back(x);
  }
  pt[0][0] = 1;
  for (int i = 0; i < n; i++) {
    if (!vis[i]) {
      ++tot;
      f[tot] = i;
      dfs(i, 1);
      for (int j = dp[tot][1]; j <= n2; j++)
        pt[tot][j] |= pt[tot - 1][j - dp[tot][1]];
      for (int j = dp[tot][2]; j <= n2; j++)
        pt[tot][j] |= pt[tot - 1][j - dp[tot][2]];
    }
  }
  if (pt[tot][n2]) {
    cout << "YES" << endl;
    memset(vis, 0, sizeof(vis));
    while (tot > 0) {
      p[tot] = 1;
      if (n2 - dp[tot][1] >= 0 && pt[tot - 1][n2 - dp[tot][1]])
        n2 -= dp[tot][1];
      else {
        n2 -= dp[tot][2];
        p[tot] = 2;
      }
      tot--;
    }
    for (int i = 0; i < n; i++) {
      if (p[bl[i]] == 2) v[i] = 3 - v[i];
      if (v[i] == 1)
        cout << 2;
      else {
        if (n1)
          cout << 1, n1--;
        else
          cout << 3;
      }
    }
    cout << endl;
  } else {
    cout << "NO" << endl;
  }
}
