#include <bits/stdc++.h>
using namespace std;
const bool debug = 0;
vector<pair<int, int> > add;
vector<vector<int> > vtx[2];
vector<int> pp;
bool dp[5001][5001];
bool solve(int i, int n) {
  if (i < 0 && n == 0) return 1;
  if (n < 0 || i < 0) return 0;
  if (dp[i][n]) return 0;
  dp[i][n] = 1;
  if (solve(i - 1, n - add[i].first)) {
    pp.push_back(0);
    return 1;
  }
  if (solve(i - 1, n - add[i].second)) {
    pp.push_back(1);
    return 1;
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m, n1, n2, n3;
  cin >> n >> m;
  cin >> n1 >> n2 >> n3;
  vector<vector<int> > g(n + 1);
  vector<int> col(n + 1, 0);
  memset(dp, 0, sizeof dp);
  while (m--) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  queue<int> q;
  for (int i = 1; i <= n; ++i) {
    if (!col[i]) {
      q.push(i);
      col[i] = 1;
      vector<int> tmp[2];
      while (!q.empty()) {
        int v = q.front();
        q.pop();
        tmp[col[v] - 1].push_back(v);
        for (auto to : g[v]) {
          if (!col[to]) {
            col[to] = col[v] % 2 + 1;
            q.push(to);
          } else if (col[to] == col[v])
            return cout << "NO", 0;
        }
      }
      vtx[0].push_back(tmp[0]);
      vtx[1].push_back(tmp[1]);
      int sz1 = tmp[0].size();
      int sz2 = tmp[1].size();
      add.push_back({sz1, sz2});
    }
  }
  int sz = add.size();
  if (!solve(sz - 1, n2)) return cout << "NO", 0;
  cout << "YES\n";
  col.assign(n + 1, 0);
  for (int i = 0; i < sz; ++i) {
    for (auto x : vtx[pp[i]][i]) col[x] = 2;
  }
  for (int i = 1; i <= n && n1 > 0; ++i) {
    if (!col[i]) {
      col[i] = 1;
      n1--;
    }
  }
  for (int i = 1; i <= n && n3 > 0; ++i) {
    if (!col[i]) {
      col[i] = 3;
      n3--;
    }
  }
  for (int i = 1; i <= n; ++i) {
    cout << col[i];
  }
  return 0;
}
