#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007LL;
int n, m;
int n1, n2, n3;
vector<int> edges[5002];
vector<vector<int>> pts[2];
int col[5002];
bool dp[5002][5002];
bool dfs(int u, int c, vector<int>& x, vector<int>& y) {
  col[u] = c;
  if (!c)
    x.push_back(u);
  else
    y.push_back(u);
  for (int i = 0; i < edges[u].size(); ++i) {
    int v = edges[u][i];
    if (col[v] < 0) {
      if (!dfs(v, !c, x, y)) return false;
    } else if (col[v] == c) {
      return false;
    }
  }
  return true;
}
void getans(string& ans, vector<int>& x, vector<int>& y) {
  for (int i = 0; i < x.size(); ++i) {
    ans[x[i] - 1] = '2';
    n2--;
  }
  for (int i = 0; i < y.size(); ++i) {
    if (n1) {
      ans[y[i] - 1] = '1';
      n1--;
    } else {
      ans[y[i] - 1] = '3';
      n3--;
    }
  }
}
int main() {
  cin >> n >> m;
  cin >> n1 >> n2 >> n3;
  for (int i = 0; i < m; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    edges[u].push_back(v);
    edges[v].push_back(u);
  }
  memset(col, -1, sizeof(col));
  int cnt = 0;
  bool ok = true;
  for (int i = 1; i <= n; ++i) {
    if (col[i] < 0) {
      vector<int> x, y;
      x.clear();
      y.clear();
      if (!dfs(i, 0, x, y)) {
        ok = false;
        break;
      }
      pts[0].push_back(x);
      pts[1].push_back(y);
      cnt++;
    }
  }
  if (!ok) {
    cout << "NO" << endl;
    return 0;
  }
  memset(dp, false, sizeof(dp));
  dp[0][0] = true;
  for (int i = 0; i < cnt; ++i) {
    for (int j = 0; j <= n; ++j) {
      if (dp[i][j]) {
        if (j + pts[0][i].size() <= n) dp[i + 1][j + pts[0][i].size()] = true;
        if (j + pts[1][i].size() <= n) dp[i + 1][j + pts[1][i].size()] = true;
      }
    }
  }
  if (!dp[cnt][n2]) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  string ans(n, ' ');
  for (int i = cnt; i >= 1; --i) {
    int sz = pts[0][i - 1].size();
    if (n2 - sz >= 0 && dp[i - 1][n2 - sz]) {
      for (int j = 0; j < pts[0][i - 1].size(); ++j) {
        ans[pts[0][i - 1][j] - 1] = '2';
        n2--;
      }
    } else {
      for (int j = 0; j < pts[1][i - 1].size(); ++j) {
        ans[pts[1][i - 1][j] - 1] = '2';
        n2--;
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    if (ans[i] == ' ') {
      if (n1) {
        ans[i] = '1';
        n1--;
      } else {
        ans[i] = '3';
        n3--;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
