#include <bits/stdc++.h>
using namespace std;
const int MAX = 5000 + 3;
const long long MOD = 1e9 + 7;
int vis[MAX];
vector<int> g[MAX];
int col[MAX];
vector<pair<int, int> > v[MAX];
int ff[MAX], ss[MAX];
int color[MAX], memo[MAX][MAX];
int n, m, n1, n2, n3, k;
void dfs(int u, int p, int cur) {
  vis[u] = 1;
  col[u] = p;
  v[cur].push_back({u, p});
  if (p == 0)
    ff[cur]++;
  else
    ss[cur]++;
  for (int x : g[u]) {
    if (col[x] == col[u]) {
      cout << "NO";
      exit(0);
    }
    if (!vis[x]) dfs(x, p ^ 1, cur);
  }
}
void rec(int id, int cur) {
  if (id > k) {
    if (cur != n2) return;
    int cnt1 = 0;
    int ans[n + 1];
    for (int i = 1; i <= k; i++) {
      for (auto x : v[i]) {
        int u = x.first, c = x.second;
        if (c == color[i])
          ans[u] = 2;
        else {
          if (cnt1 < n1)
            cnt1++, ans[u] = 1;
          else
            ans[u] = 3;
        }
      }
    }
    cout << "YES\n";
    for (int i = 1; i <= n; i++) cout << ans[i];
    exit(0);
  }
  if (memo[id][cur] != -1) return;
  memo[id][cur] = 1;
  color[id] = 0;
  rec(id + 1, cur + ff[id]);
  color[id] = 1;
  rec(id + 1, cur + ss[id]);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  cin >> n1 >> n2 >> n3;
  memset(col, -1, sizeof col);
  memset(memo, -1, sizeof memo);
  memset(color, -1, sizeof color);
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v), g[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) {
      dfs(i, 0, ++k);
    }
  }
  rec(1, 0);
  cout << "NO";
}
