#include <bits/stdc++.h>
using namespace std;
long long n, m, a, b, cnt[5005], n1, n2, n3, ans1[5005], ans2[5005],
    ccnt = 0, dp[5005][5005], vis[5005], d = 1, va[5005], ud[5005], pr[5005],
    hi;
vector<long long> v[5005];
map<long long, long long> m1;
void dfs1(int x) {
  if (vis[x] == 0) {
    vis[x] = 1;
    if (va[x] == 0) {
      pr[x] = 2;
    } else {
      if (n1 > 0) {
        pr[x] = 1;
        n1--;
      } else {
        pr[x] = 3;
      }
    }
    for (int kk = 0; kk < cnt[x]; kk++) {
      dfs1(v[x][kk]);
    }
  }
}
void dfs2(int x) {
  if (vis[x] == 0) {
    vis[x] = 1;
    if (va[x] == 1) {
      pr[x] = 2;
    } else {
      if (n1 > 0) {
        pr[x] = 1;
        n1--;
      } else {
        pr[x] = 3;
      }
    }
    for (int tt = 0; tt < cnt[x]; tt++) {
      dfs2(v[x][tt]);
    }
  }
}
void dfs(int x) {
  if (va[x] == -1) {
    if (m1[x] % 2 == 0) {
      va[x] = 0;
      ans1[ccnt]++;
    } else {
      va[x] = 1;
      ans2[ccnt]++;
    }
  } else {
    if (va[x] != m1[x] % 2) {
      d = 0;
    }
  }
  if (vis[x] == 0) {
    vis[x] = 1;
    for (int jj = 0; jj < cnt[x]; jj++) {
      m1[v[x][jj]] = m1[x] + 1;
      dfs(v[x][jj]);
    }
  }
}
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  for (int i = 0; i < 5002; i++) {
    cnt[i] = 0;
    ans1[i] = 0;
    ans2[i] = 0;
    va[i] = -1;
  }
  for (int i = 0; i <= 5001; i++) {
    for (int j = 0; j <= 5001; j++) {
      dp[i][j] = 0;
    }
  }
  cin >> n >> m;
  cin >> n1 >> n2 >> n3;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
    cnt[a]++;
    cnt[b]++;
  }
  for (int i = 1; i <= n; i++) {
    if (vis[i] == 0) {
      m1[i] = 0;
      dfs(i);
      ccnt++;
    }
  }
  if (d == 0) {
    cout << "NO" << '\n';
  } else {
    dp[0][ans1[0]] = 1;
    dp[0][ans2[0]] = 1;
    for (int i = 1; i < ccnt; i++) {
      for (int j = 0; j <= n2; j++) {
        if (j >= ans1[i]) {
          if (dp[i - 1][j - ans1[i]]) {
            dp[i][j] = 1;
          }
        }
        if (j >= ans2[i]) {
          if (dp[i - 1][j - ans2[i]]) {
            dp[i][j] = 1;
          }
        }
      }
    }
    if (dp[ccnt - 1][n2] == 0) {
      cout << "NO" << '\n';
    } else {
      cout << "YES" << '\n';
      a = n2;
      for (int i = ccnt - 1; i > 0; i--) {
        if (a >= ans1[i] && dp[i - 1][a - ans1[i]]) {
          ud[i] = 1;
          a = a - ans1[i];
        } else {
          ud[i] = 2;
          a = a - ans2[i];
        }
      }
      if (a == ans1[0]) {
        ud[0] = 1;
      } else {
        ud[0] = 2;
      }
      for (int i = 1; i <= n; i++) {
        vis[i] = 0;
      }
      hi = 0;
      for (int i = 1; i <= n; i++) {
        if (vis[i] == 0) {
          if (ud[hi] == 1) {
            dfs1(i);
          } else {
            dfs2(i);
          }
          hi++;
        }
      }
      for (int i = 1; i <= n; i++) {
        cout << pr[i];
      }
    }
  }
}
