#include <bits/stdc++.h>
using namespace std;
const int maxn = 5005;
int n, m;
int n1, n2, n3;
vector<int> gr[maxn];
int col[maxn];
bool stop = false;
bool vis[maxn];
vector<pair<int, int> > v;
vector<int> ver[maxn];
bool dp[maxn][maxn];
int ans[maxn];
void read_input() {
  cin >> n >> m;
  cin >> n1 >> n2 >> n3;
  for (int i = 1; i <= m; ++i) {
    int u, v;
    cin >> u >> v;
    gr[u].push_back(v);
    gr[v].push_back(u);
  }
}
void dfs1(int u) {
  if (stop) return;
  for (int v : gr[u]) {
    if (col[v] == -1) {
      col[v] = col[u] ^ 1;
      dfs1(v);
    } else {
      if (col[v] != (col[u] ^ 1)) {
        stop = true;
        break;
      }
    }
  }
}
void dfs2(int u, int& cnt0, int& cnt1, vector<int>& ver) {
  vis[u] = true;
  ver.push_back(u);
  if (col[u])
    ++cnt1;
  else
    ++cnt0;
  for (int v : gr[u])
    if (!vis[v]) dfs2(v, cnt0, cnt1, ver);
}
bool is_bipartite() {
  fill(col, col + n + 1, -1);
  for (int i = 1; i <= n; ++i)
    if (col[i] == -1) {
      col[i] = 0;
      dfs1(i);
      if (stop) break;
    }
  if (stop) return false;
  return true;
}
void solve() {
  if (!is_bipartite()) {
    cout << "NO\n";
    return;
  }
  fill(vis + 1, vis + n + 1, false);
  for (int i = 1; i <= n; ++i)
    if (!vis[i]) {
      int cnt0 = 0, cnt1 = 0;
      dfs2(i, cnt0, cnt1, ver[(int)v.size()]);
      v.push_back(pair<int, int>(cnt0, cnt1));
    }
  fill_n(&dp[0][0], sizeof(dp) / sizeof(dp[0][0]), false);
  dp[0][0] = true;
  for (int i = 0; i < (int)v.size(); ++i)
    for (int j = 0; j < n; ++j) {
      if (!dp[i][j]) continue;
      dp[i + 1][j + v[i].first] = true;
      dp[i + 1][j + v[i].second] = true;
    }
  if (!dp[(int)v.size()][n2]) {
    cout << "NO\n";
    return;
  }
  fill(ans + 1, ans + n + 1, -1);
  int cur = n2;
  for (int i = (int)v.size() - 1; i >= 0; --i) {
    if (cur >= v[i].first && dp[i][cur - v[i].first]) {
      for (auto& x : ver[i])
        if (col[x] == 0) ans[x] = 2;
      cur -= v[i].first;
    } else {
      assert(dp[i][cur - v[i].second]);
      for (auto& x : ver[i])
        if (col[x] == 1) ans[x] = 2;
      cur -= v[i].second;
    }
  }
  for (int i = 1; i <= n; ++i) {
    if (ans[i] != -1) continue;
    if (n1) {
      ans[i] = 1;
      --n1;
    } else
      ans[i] = 3;
  }
  cout << "YES\n";
  for (int i = 1; i <= n; ++i) cout << ans[i];
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  read_input();
  solve();
}
