#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pci = pair<char, int>;
mt19937 rnd(5512365);
const int inf = 1e9 + 7;
using bt = bitset<700000>;
template <class T>
using vec = vector<T>;
ld pi = atan2(0, -1);
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("fast-math")
#pragma GCC optimize("vpt")
void solve(int numtest) {
  int n, m;
  cin >> n >> m;
  vec<vec<int>> g(n);
  int n1, n2, n3;
  cin >> n1 >> n2 >> n3;
  while (m--) {
    int u, v;
    cin >> u >> v;
    --u, --v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  vector<int> used(n);
  vec<pair<vec<int>, vec<int>>> arr;
  for (int i = 0; i < n; ++i) {
    if (!used[i]) {
      queue<int> q;
      q.push(i);
      vector<int> col(n);
      col[i] = 1;
      vector<int> v1 = {i};
      used[i] = 1;
      vec<int> v2;
      while (!q.empty()) {
        int v = q.front();
        q.pop();
        for (auto u : g[v]) {
          if (!col[u]) {
            used[u] = 1;
            col[u] = 3 - col[v];
            if (col[u] == 1) {
              v1.push_back(u);
            } else {
              v2.push_back(u);
            }
            q.push(u);
          } else if (col[v] == col[u]) {
            cout << "NO\n";
            exit(0);
          }
        }
      }
      arr.push_back({v1, v2});
    }
  }
  m = arr.size();
  vector<vector<int>> dp(m + 1, vector<int>(n + 1));
  vector<vector<int>> p(m + 1, vector<int>(n + 1, -1));
  dp[0][0] = 1;
  for (int i = 1; i <= m; ++i) {
    int sz1 = arr[i - 1].first.size();
    int sz2 = arr[i - 1].second.size();
    for (int j = 0; j <= n; ++j) {
      if (j >= sz1 && dp[i - 1][j - sz1]) {
        dp[i][j] = 1;
        p[i][j] = 0;
      }
      if (j >= sz2 && dp[i - 1][j - sz2]) {
        dp[i][j] = 1;
        p[i][j] = 1;
      }
    }
  }
  vector<int> v2;
  if (!dp[m][n2]) {
    cout << "NO\n";
    return;
  }
  int nun = m;
  int cur = n2;
  while (v2.size() < n2) {
    if (p[nun][cur] == 0) {
      for (auto elem : arr[nun - 1].first) {
        v2.push_back(elem);
      }
      cur -= arr[nun - 1].first.size();
    } else {
      for (auto elem : arr[nun - 1].second) {
        v2.push_back(elem);
      }
      cur -= arr[nun - 1].second.size();
    }
    nun--;
  }
  vector<int> ans(n);
  for (auto elem : v2) {
    ans[elem] = 2;
  }
  for (int i = 0; i < n; ++i) {
    if (ans[i]) continue;
    if (n1) {
      ans[i] = 1;
      n1--;
    } else {
      ans[i] = 3;
    }
  }
  for (int i = 0; i < n; ++i) {
    for (auto u : g[i]) {
      if (abs(ans[i] - ans[u]) != 1) {
        cout << "NO\n";
        exit(0);
      }
    }
  }
  cout << "YES\n";
  for (auto elem : ans) cout << elem;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int tt = 1;
  cout << fixed << setprecision(10);
  for (int test = 0; test < tt; ++test) {
    solve(test + 1);
  }
  return 0;
}
