#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int> >;
using P = pair<int, int>;
constexpr char newl = '\n';
bool dfs(int cur, const Graph& g, int ii, vector<int>& bi, vector<int>& ids,
         int& cnt0, int& cnt1) {
  for (int nex : g[cur]) {
    if (bi[nex] == bi[cur]) return false;
    if (bi[nex] != -1) continue;
    bi[nex] = 1 - bi[cur];
    (bi[nex] == 0 ? cnt0 : cnt1)++;
    ids[nex] = ii;
    if (!dfs(nex, g, ii, bi, ids, cnt0, cnt1)) return false;
  }
  return true;
}
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  int n1, n2, n3;
  cin >> n1 >> n2 >> n3;
  Graph g(n);
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    --u;
    --v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  vector<int> bi(n, -1);
  vector<int> ids(n, -1);
  vector<P> memo;
  int ii = 0;
  for (int i = 0; i < n; i++) {
    if (bi[i] != -1) continue;
    bi[i] = 0;
    ids[i] = ii;
    int cnt0 = 1;
    int cnt1 = 0;
    if (!dfs(i, g, ii, bi, ids, cnt0, cnt1)) {
      cout << "NO\n";
      return 0;
    }
    ++ii;
    memo.emplace_back(cnt0, cnt1);
  }
  int sz = memo.size();
  vector<vector<int> > dp(sz + 1, vector<int>(n2 + 1, false));
  vector<vector<int> > prv(sz + 1, vector<int>(n2 + 1, -1));
  dp[0][0] = true;
  for (int j = 0; j < sz; ++j) {
    auto p = memo[j];
    for (int i = 0; i <= n2; i++) {
      if (!dp[j][i]) continue;
      if (i + p.first <= n2) {
        dp[j + 1][i + p.first] = true;
        prv[j + 1][i + p.first] = 0;
      }
      if (i + p.second <= n2) {
        dp[j + 1][i + p.second] = true;
        prv[j + 1][i + p.second] = 1;
      }
    }
  }
  if (!dp[sz][n2]) {
    cout << "NO\n";
    return 0;
  }
  int cur = n2;
  vector<int> vv;
  for (int i = sz; i > 0; i--) {
    vv.push_back(prv[i][cur]);
    int hoge = (prv[i][cur] == 0 ? memo[i - 1].first : memo[i - 1].second);
    cur -= hoge;
  }
  reverse(vv.begin(), vv.end());
  cout << "YES\n";
  for (int i = 0; i < n; i++) {
    if (vv[ids[i]] == bi[i]) {
      cout << '2';
    } else {
      cout << (n1-- > 0 ? '1' : '3');
    }
  }
  cout << newl;
  return 0;
}
