#include <bits/stdc++.h>
using namespace std;
void init() {}
void solve() {
  int n, m;
  cin >> n >> m;
  int n1, n2, n3;
  cin >> n1 >> n2 >> n3;
  vector<vector<int> > e(n);
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    --a, --b;
    e[a].emplace_back(b);
    e[b].emplace_back(a);
  }
  vector<bool> vis(n, false);
  vector<int> res(n, 0);
  vector<vector<int> > data;
  for (int i = 0; i < n; ++i) {
    if (vis[i]) {
      continue;
    }
    vis[i] = true;
    int c1 = 1, c0 = 0;
    queue<int> q;
    q.push(i);
    res[i] = 1;
    while (!q.empty()) {
      int v = q.front();
      q.pop();
      for (auto& u : e[v]) {
        if (!vis[u]) {
          vis[u] = true;
          q.push(u);
          res[u] = res[v] ^ 1;
          (res[u] ? c1 : c0) += 1;
        } else {
          if (res[u] == res[v]) {
            cout << "NO\n";
            return;
          }
        }
      }
    }
    data.emplace_back(vector<int>{i, c1, c0});
  }
  vector<vector<int> > dp(data.size() + 1, vector<int>(5001, 0));
  dp[0][0] = 1;
  for (int i = 0; i < data.size(); ++i) {
    auto& mp_prev = dp[i];
    auto& mp = dp[i + 1];
    int j1 = data[i][1];
    int j2 = data[i][2];
    for (int j = 0; j < mp_prev.size(); ++j) {
      if (!mp_prev[j]) {
        continue;
      }
      if (j + j1 < mp.size()) {
        mp[j + j1] = 1;
      }
      if (j + j2 < mp.size()) {
        mp[j + j2] = 2;
      }
    }
  }
  if (dp.back()[n2] == 0) {
    cout << "NO\n";
    return;
  }
  for (int i = 0; i < n; ++i) {
    vis[i] = false;
    res[i] = 0;
  }
  for (int i = dp.size() - 1, ps = n2; i; --i) {
    int j = dp[i][ps];
    ps -= data[i - 1][j];
    int v = data[i - 1][0];
    vis[v] = true;
    queue<int> q;
    q.push(v);
    res[v] = j == 1 ? 2 : 0;
    while (!q.empty()) {
      v = q.front();
      q.pop();
      for (auto& u : e[v]) {
        if (!vis[u]) {
          vis[u] = true;
          q.push(u);
          res[u] = res[v] ^ 2;
        }
      }
    }
  }
  cout << "YES\n";
  for (auto& x : res) {
    if (!x) {
      x = n1 > 0 ? 1 : 3;
      --n1;
    }
    cout << x;
  }
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  init();
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
