#include <bits/stdc++.h>
using namespace std;
const int N = 5000 + 10;
vector<int> g[N];
bool yes;
int one, zero;
int color[N];
int n, m;
int nn[3];
vector<pair<int, int>> wt;
int dp[N][N];
vector<int> comp[N][2];
int k;
void dfs(int u) {
  if (!color[u])
    zero++;
  else
    one++;
  comp[k][color[u]].push_back(u);
  for (auto v : g[u]) {
    if (color[v] == -1) {
      color[v] = color[u] ^ 1;
      dfs(v);
    } else if (color[u] == color[v])
      yes = false;
  }
}
int main() {
  cin >> n >> m;
  memset(color, -1, sizeof(color));
  for (int i = 0; i < 3; i++) cin >> nn[i];
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  int tot = -1;
  for (int i = 0; i < n; i++) {
    if (color[i] == -1) {
      yes = true;
      one = 0;
      zero = 0;
      tot++;
      k = tot;
      color[i] = 0;
      dfs(i);
      if (!yes) {
        cout << "NO";
        return 0;
      }
      wt.push_back(make_pair(zero, one));
    }
  }
  memset(dp, -1, sizeof(dp));
  dp[0][0] = 0;
  for (int i = 0; i < wt.size(); i++) {
    for (int j = 0; j < N; j++) {
      if (dp[i][j] != -1) {
        dp[i + 1][j + wt[i].first] = 0;
        dp[i + 1][j + wt[i].second] = 1;
      }
    }
  }
  if (dp[wt.size()][nn[1]] == -1) {
    cout << "NO";
    return 0;
  }
  cout << "YES" << endl;
  int ans[n];
  memset(ans, -1, sizeof(ans));
  int have = nn[1];
  for (int i = wt.size(); i > 0; i--) {
    for (auto j : comp[i - 1][dp[i][have]]) {
      ans[j] = 2;
    }
    have -= comp[i - 1][dp[i][have]].size();
  }
  for (int i = 0; i < n; i++) {
    if (ans[i] == -1) {
      if (nn[0] > 0) {
        ans[i] = 1;
        nn[0] -= 1;
      } else {
        ans[i] = 3;
      }
    }
  }
  for (int i = 0; i < n; i++) cout << ans[i];
}
