#include <bits/stdc++.h>
using namespace std;
const long long INF = (long long)1e18;
const int mod = (int)1e9 + 7;
const int MAXN = (int)3e5 + 5;
long long n, m;
vector<int> adj[MAXN];
int color[MAXN];
int c1, c2, n1, n2, n3;
bool dfs(int v, int par) {
  bool truth = 0;
  for (int u : adj[v]) {
    if (u == par) continue;
    if (color[u] == color[v]) truth = 1;
    if (color[u] == 0) {
      color[u] = 3 - color[v];
      if (color[u] == 1)
        c1++;
      else
        c2++;
      truth = (truth || dfs(u, v));
    }
  }
  return truth;
}
vector<int> cmps;
vector<pair<int, int> > vc;
int dp[7000000];
bool ile[7000000];
bool d(int a, int b, int i) {
  int idx = a * (n1 + 1) + b;
  if (a > n2 || b > n1) return 0;
  if (a == n2 && b == n1 && i == cmps.size()) return dp[idx] = 1;
  if (i == cmps.size()) return dp[idx] = 0;
  if (dp[idx] != -1) {
    return dp[idx];
  }
  if (d(a + vc[i].first, b + vc[i].second, i + 1)) {
    ile[idx] = 0;
    return dp[idx] = 1;
  } else if (d(a + vc[i].second, b + vc[i].first, i + 1)) {
    ile[idx] = 1;
    return dp[idx] = 1;
  } else {
    return dp[idx] = 0;
  }
}
char ans[MAXN];
void dfs2(int a, int par, int k) {
  ans[a - 1] = '0' + k;
  for (int j : adj[a]) {
    if (j != par && ans[j - 1] != '1' && ans[j - 1] != '2') {
      dfs2(j, a, 3 - k);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> n >> m;
  cin >> n1 >> n2 >> n3;
  n1 += n3;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  for (int i = 1; i <= n; i++) {
    if (color[i] == 0) {
      cmps.push_back(i);
      c1 = 1;
      c2 = 0;
      color[i] = 1;
      if (dfs(i, -1)) {
        cout << "NO" << '\n';
        return 0;
      }
      vc.push_back({c1, c2});
    }
  }
  memset(dp, -1, sizeof(dp));
  if (d(0, 0, 0)) {
    cout << "YES" << '\n';
    int a = 0, b = 0;
    ans[n] = '\0';
    for (int i = 0; i < cmps.size(); i++) {
      int curi = a * (n1 + 1) + b;
      if (ile[curi] == 0) {
        a += vc[i].first;
        b += vc[i].second;
        dfs2(cmps[i], -1, 2);
      } else {
        a += vc[i].second;
        b += vc[i].first;
        dfs2(cmps[i], -1, 1);
      }
    }
    int cnt = 0;
    for (int i = 0; i < n; i++) {
      if (cnt == n3) break;
      if (ans[i] == '1') {
        ans[i] = '3';
        cnt++;
      }
    }
    cout << ans << '\n';
  } else {
    cout << "NO" << '\n';
  }
}
