#include <bits/stdc++.h>
using namespace std;
const long long l_inf = numeric_limits<long long>::max();
const long long l_ninf = numeric_limits<long long>::min();
const int inf = numeric_limits<int>::max();
const int ninf = numeric_limits<int>::min();
const double pi = 1.00 * acos(-1.00);
const double eps = 1e-8;
void cio() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return (a * (b / gcd(a, b))); }
int sq(int x) { return x * x; }
const int maxn = 5005;
int V, E;
int n1, n2, n3;
vector<int> graph[maxn];
bool vis[maxn];
int dist[maxn];
bool check;
vector<int> cc[maxn];
int cnt;
pair<int, int> cnum[maxn];
int dp[maxn][maxn];
void dfs(int u) {
  vis[u] = true;
  cc[cnt].push_back(u);
  if (dist[u] & 1)
    cnum[cnt].first++;
  else
    cnum[cnt].second++;
  for (auto v : graph[u]) {
    if (!vis[v]) {
      dist[v] = dist[u] + 1;
      dfs(v);
    } else {
      if (dist[u] % 2 == dist[v] % 2) {
        check = false;
        break;
      }
    }
  }
}
int getdp(int id, int val) {
  if (id == 0) {
    if (val == 0)
      return 3;
    else
      return 0;
  }
  int &ret = dp[id][val];
  if (ret != -1) return ret;
  if (getdp(id - 1, val - cnum[id].first))
    ret = 1;
  else if (getdp(id - 1, val - cnum[id].second))
    ret = 2;
  else
    ret = 0;
  return ret;
}
void knapsack() {
  memset(dp, -1, sizeof(dp));
  if (!getdp(cnt, n2))
    printf("NO\n");
  else {
    vector<pair<int, int> > ans;
    int id = cnt, val = n2;
    while (id) {
      if (dp[id][val] == 1) {
        for (auto x : cc[id]) {
          if (dist[x] & 1)
            ans.push_back({x, 2});
          else {
            if (n1) {
              ans.push_back({x, 1});
              n1--;
            } else
              ans.push_back({x, 3});
          }
        }
        val -= cnum[id].first;
      } else {
        for (auto x : cc[id]) {
          if (!(dist[x] & 1))
            ans.push_back({x, 2});
          else {
            if (n1) {
              ans.push_back({x, 1});
              n1--;
            } else
              ans.push_back({x, 3});
          }
        }
        val -= cnum[id].second;
      }
      id--;
    }
    sort(ans.begin(), ans.end());
    printf("YES\n");
    for (auto ai : ans) printf("%d", ai.second);
    printf("\n");
  }
}
void solve() {
  memset(dist, -1, sizeof(dist));
  check = true;
  for (int i = 1; i <= V; i++)
    if (!vis[i]) {
      cnt++;
      dist[i] = 0;
      dfs(i);
      if (!check) break;
    }
  if (!check)
    printf("NO\n");
  else
    knapsack();
}
int main() {
  scanf("%d%d", &V, &E);
  scanf("%d%d%d", &n1, &n2, &n3);
  for (int i = 1; i <= E; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    graph[u].push_back(v);
    graph[v].push_back(u);
  }
  solve();
}
