#include <bits/stdc++.h>
using namespace std;
bool isbp(int v, int n, int &cnt1, int &cnt2, vector<vector<int>> &Graph,
          vector<bool> &visited) {
  queue<pair<int, int>> q;
  visited[v] = true;
  vector<bool> col(n + 5);
  vector<int> visver;
  q.push({v, 0});
  while (!q.empty()) {
    auto ver = q.front();
    q.pop();
    visver.push_back(ver.first);
    if (ver.second & 1)
      ++cnt2;
    else
      ++cnt1;
    for (auto vv : Graph[ver.first])
      if (!visited[vv]) {
        visited[vv] = true;
        col[vv] = !col[ver.first];
        q.push({vv, ver.second + 1});
      }
  }
  for (auto ver : visver)
    for (auto nbr : Graph[ver])
      if (col[nbr] == col[ver]) return 0;
  return 1;
}
void dfs(int v, int &n1, int &n3, vector<vector<int>> &Graph,
         vector<bool> &visited, vector<int> &col, int depth) {
  visited[v] = true;
  if (depth & 1) {
    if (n1)
      col[v] = 1, --n1;
    else
      col[v] = 3, --n3;
  } else
    col[v] = 2;
  for (auto vv : Graph[v])
    if (!visited[vv]) dfs(vv, n1, n3, Graph, visited, col, depth + 1);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, n1, n2, n3, m, v1, v2, cnt1, cnt2;
  cin >> n >> m >> n1 >> n2 >> n3;
  vector<vector<int>> Graph(n + 5);
  vector<int> depth(n + 5), col(n + 5), ind = {0};
  vector<pair<int, int>> poss = {{0, 0}};
  vector<bool> visited(n + 5);
  while (m--) {
    cin >> v1 >> v2;
    Graph[v1].push_back(v2);
    Graph[v2].push_back(v1);
  }
  for (int i = 1; i <= n; ++i)
    if (!visited[i]) {
      cnt1 = cnt2 = 0;
      if (!isbp(i, n, cnt1, cnt2, Graph, visited))
        return cout << "NO" << endl, 0;
      ind.push_back(i);
      poss.push_back({cnt1, cnt2});
    }
  visited.clear();
  visited.resize(n + 5);
  vector<vector<int>> dp(ind.size(), vector<int>(n2 + 5));
  dp[0][0] = 1;
  for (int i = 1; i < ind.size(); ++i)
    for (int j = min(poss[i].first, poss[i].second); j <= n2; ++j) {
      if (j >= poss[i].first && dp[i - 1][j - poss[i].first])
        dp[i][j] = 1;
      else if (j >= poss[i].second && dp[i - 1][j - poss[i].second])
        dp[i][j] = 2;
    }
  if (!dp[ind.size() - 1][n2]) return cout << "NO" << endl, 0;
  int vsf = n2;
  for (int i = ind.size() - 1; i > 0; --i)
    if (dp[i][vsf] == 1) {
      dfs(ind[i], n1, n3, Graph, visited, col, 0);
      vsf -= poss[i].first;
    } else {
      dfs(ind[i], n1, n3, Graph, visited, col, 1);
      vsf -= poss[i].second;
    }
  cout << "YES" << '\n';
  for (int i = 1; i <= n; ++i) cout << col[i];
}
