#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int N = 5e3 + 4;
vector<int> v[N];
int visit[N], col[N];
vector<pair<vector<int>, vector<int>>> comp;
pair<vector<int>, vector<int>> cur_comp;
int whites = 0, blacks = 0;
void dfs(int node) {
  visit[node] = 1;
  if (col[node] == 0)
    cur_comp.first.push_back(node), whites++;
  else
    cur_comp.second.push_back(node), blacks++;
  for (int it : v[node]) {
    if (visit[it]) {
      if (col[node] == col[it]) {
        printf("NO");
        exit(0);
      }
    } else {
      col[it] = (!col[node]);
      dfs(it);
    }
  }
}
bool dp[N][N];
int main() {
  int n, m;
  scanf("%d", &n);
  scanf("%d", &m);
  int a, b, c;
  scanf("%d", &a);
  scanf("%d", &b);
  scanf("%d", &c);
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d", &x);
    scanf("%d", &y);
    v[x].push_back(y);
    v[y].push_back(x);
  }
  vector<pair<int, int>> comp_data;
  for (int i = 1; i < n + 1; i++)
    if (!visit[i]) {
      cur_comp.first.clear();
      cur_comp.second.clear();
      blacks = whites = 0;
      dfs(i);
      comp.push_back(cur_comp);
      comp_data.emplace_back(whites, blacks);
    }
  int sz = (int)comp_data.size();
  dp[0][0] = 1;
  for (int i = 0; i < sz; i++) {
    int whites_here = comp_data[i].first, blacks_here = comp_data[i].second;
    for (int j = 0; j < n + 1; j++)
      if (dp[i][j]) {
        if (j + whites_here < N) dp[i + 1][j + whites_here] = dp[i][j];
        if (j + blacks_here < N) dp[i + 1][j + blacks_here] = dp[i][j];
      }
  }
  set<int> st;
  if (dp[sz][b] == 0) {
    printf("NO");
    return 0;
  }
  int cur = b;
  for (int i = sz; i > 0; i--) {
    int whites_here = comp_data[i - 1].first,
        blacks_here = comp_data[i - 1].second;
    if (cur - whites_here >= 0 and dp[i - 1][cur - whites_here]) {
      cur -= whites_here;
      for (int it : comp[i - 1].first) st.insert(it);
    } else {
      cur -= blacks_here;
      for (int it : comp[i - 1].second) st.insert(it);
    }
  }
  int final_color[n + 1];
  for (int i = 1; i < n + 1; i++) {
    if (st.find(i) != st.end())
      final_color[i] = 2;
    else {
      if (a)
        final_color[i] = 1, a--;
      else
        final_color[i] = 3;
    }
  }
  printf("YES\n");
  for (int i = 1; i < n + 1; i++) printf("%d", final_color[i]);
  return 0;
}
