#include <bits/stdc++.h>
using namespace std;
const int maxn = 5 * 1000 + 10;
bool bad, mark[maxn], c[maxn], park[maxn];
int n[3], N, m, u, v, col[maxn], ted, par[maxn], g;
vector<int> vec[maxn], idk[2];
vector<pair<vector<int>, vector<int>>> com;
void dfs(int x) {
  idk[(int)c[x]].push_back(x);
  if (bad) return;
  mark[x] = 1;
  for (auto &w : vec[x]) {
    if (mark[w]) {
      if (c[w] == c[x]) {
        bad = 1;
        break;
      }
      continue;
    }
    c[w] = !c[x];
    dfs(w);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> N >> m;
  for (int i = 0; i < 3; i++) cin >> n[i];
  for (int i = 0; i < m; i++) {
    cin >> u >> v;
    u--;
    v--;
    vec[u].push_back(v);
    vec[v].push_back(u);
  }
  for (int i = 0; i < N; i++) {
    if (!mark[i]) {
      idk[0].clear();
      idk[1].clear();
      dfs(i);
      if (bad) {
        cout << "NO";
        return 0;
      }
      ted += min((((int)idk[0].size())), (((int)idk[1].size())));
      if ((((int)idk[0].size())) > (((int)idk[1].size())))
        com.push_back({idk[1], idk[0]});
      else
        com.push_back({idk[0], idk[1]});
    }
  }
  if (ted > n[1]) {
    cout << "NO";
    return 0;
  }
  g = n[1] - ted;
  memset(mark, 0, sizeof mark);
  mark[0] = 1;
  memset(par, -1, sizeof par);
  for (int i = 0; i < (((int)com.size())); i++) {
    u = (((int)com[i].second.size())) - (((int)com[i].first.size()));
    for (int j = g; j >= u; j--) {
      if (mark[j]) continue;
      if (mark[j - u]) {
        mark[j] = 1;
        par[j] = i;
      }
    }
  }
  if (g > 0 && par[g] == -1) {
    cout << "NO";
    return 0;
  }
  u = g;
  while (u > 0) {
    park[par[u]] = 1;
    v = (((int)com[par[u]].second.size())) - (((int)com[par[u]].first.size()));
    u -= v;
  }
  for (int i = 0; i < (((int)com.size())); i++) {
    if (park[i]) {
      for (auto &w : com[i].second) col[w] = 2;
      for (auto &w : com[i].first) {
        if (n[0] > 0) {
          n[0]--;
          col[w] = 1;
        } else
          col[w] = 3;
      }
    } else {
      for (auto &w : com[i].first) col[w] = 2;
      for (auto &w : com[i].second) {
        if (n[0] > 0) {
          n[0]--;
          col[w] = 1;
        } else
          col[w] = 3;
      }
    }
  }
  cout << "YES" << endl;
  for (int i = 0; i < N; i++) cout << col[i];
  return 0;
}
