#include <bits/stdc++.h>
using namespace std;
const int N = 5001;
int p1[N], p2[N], n1, n2, n3, n, m, u, v, vis[N], f, par[N], c1, c2, rec, curr;
int res[N][N], ans[N];
vector<int> vec[N], pp1[N], pp2[N];
void solve(int node, int value) {
  if (node == n + 1) {
    if (value == n2) rec = 1;
    return;
  }
  if (res[node][value]) return;
  res[node][value] = 1;
  solve(node + 1, p1[node] + value);
  if (rec == 1) {
    for (auto u : pp1[node]) ans[u] = 2;
    return;
  }
  solve(node + 1, p2[node] + value);
  if (rec == 1) {
    for (auto u : pp2[node]) ans[u] = 2;
    return;
  }
}
void dfs(int node, int p) {
  if (p % 2)
    pp1[curr].push_back(node);
  else
    pp2[curr].push_back(node);
  int i, c;
  vis[node] = true;
  par[node] = p;
  if (p % 2)
    ++c1, c = 2;
  else
    ++c2, c = 1;
  for (i = 0; i < vec[node].size(); ++i) {
    if (!vis[vec[node][i]])
      dfs(vec[node][i], c);
    else if (((par[node] - par[vec[node][i]]) % 2) == 0) {
      f = 1;
    }
  }
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int i, j;
  cin >> n >> m >> n1 >> n2 >> n3;
  for (i = 1; i <= m; ++i) {
    cin >> u >> v;
    vec[u].push_back(v);
    vec[v].push_back(u);
  }
  for (i = 1; i <= n; ++i) {
    if (!vis[i]) {
      curr = i;
      c1 = c2 = 0;
      dfs(i, 1);
      p1[i] = c1;
      p2[i] = c2;
    }
  }
  solve(1, 0);
  if (rec && !f) {
    cout << "YES\n";
    for (i = 1; i <= n; ++i) {
      if (ans[i])
        cout << 2;
      else if (n1 != 0) {
        cout << 1;
        --n1;
      } else
        cout << 3;
    }
  } else {
    cout << "NO\n";
  }
  return 0;
}
