#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
int n, m, n1, n2, n3;
vector<int> a[5010];
int col[5010];
int nowcol;
bool gg;
bool vis[5010];
int cnt;
vector<int> b[5010], w[5010];
bool dp[5010][5010];
bool memo[5010][5010];
int trans[5010][5010];
bool f(int x, int y) {
  if (x == cnt) {
    if (y == n2)
      return 1;
    else
      return 0;
  }
  if (memo[x][y]) return dp[x][y];
  bool ok = f(x + 1, y + b[x].size());
  if (ok == 1) {
    trans[x][y] = 1;
    memo[x][y] = 1;
    dp[x][y] = 1;
    return 1;
  }
  ok = f(x + 1, y + w[x].size());
  if (ok == 1) {
    trans[x][y] = 2;
    memo[x][y] = 1;
    dp[x][y] = 1;
    return 1;
  }
  memo[x][y] = 1;
  dp[x][y] = 0;
  return 0;
}
void dfs(int x) {
  col[x] = nowcol;
  for (int i = 0; i < int(a[x].size()); i++) {
    if (col[a[x][i]] == nowcol) {
      gg = 1;
      break;
    } else if (!col[a[x][i]]) {
      nowcol = 3 - nowcol;
      dfs(a[x][i]);
      nowcol = 3 - nowcol;
    }
  }
}
void dfs2(int x) {
  if (col[x] == 1)
    b[cnt].push_back(x);
  else
    w[cnt].push_back(x);
  vis[x] = 1;
  for (int i = 0; i < int(a[x].size()); i++)
    if (!vis[a[x][i]]) dfs2(a[x][i]);
}
int op[5010];
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cin >> n >> m >> n1 >> n2 >> n3;
  for (int i = 0; i < int(m); i++) {
    int x, y;
    cin >> x >> y;
    a[x].push_back(y);
    a[y].push_back(x);
  }
  nowcol = 1;
  for (int i = 1; i <= int(n); i++)
    if (!col[i]) dfs(i);
  if (gg) {
    cout << "NO" << endl;
    return 0;
  }
  for (int i = 1; i <= int(n); i++)
    if (!vis[i]) {
      dfs2(i);
      cnt++;
    }
  if (!f(0, 0)) {
    cout << "NO" << endl;
    return 0;
  }
  int nowx = 0;
  int nowy = 0;
  while (nowx != cnt) {
    if (trans[nowx][nowy] == 1) {
      for (int i = 0; i < int(b[nowx].size()); i++) op[b[nowx][i]] = 2;
      nowy += b[nowx].size();
      nowx++;
    } else {
      for (int i = 0; i < int(w[nowx].size()); i++) op[w[nowx][i]] = 2;
      nowy += w[nowx].size();
      nowx++;
    }
  }
  cout << "YES" << endl;
  for (int i = 1; i <= int(n); i++) {
    if (!op[i] && n1) {
      cout << 1;
      n1--;
    } else if (!op[i] && !n1) {
      cout << 3;
    } else
      cout << 2;
  }
  cout << endl;
}
