#include <bits/stdc++.h>
using namespace std;
int N, M, S, T, dS, dT;
int f[200005];
int fs[200005], ft[200005];
vector<int> edg[200005];
vector<pair<int, int> > edges;
int fth(int x) {
  if (f[x] == x) return x;
  return f[x] = fth(f[x]);
}
bool cmp(int a, int b) { return fth(a) < fth(b); }
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 1; i <= M; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    edg[x].push_back(y);
    edg[y].push_back(x);
  }
  scanf("%d%d%d%d", &S, &T, &dS, &dT);
  for (int i = 1; i <= N; i++) f[i] = i;
  for (int i = 1; i <= N; i++) {
    if (i == S || i == T) continue;
    for (auto nxt : edg[i]) {
      if (nxt == S || nxt == T) continue;
      int f1 = fth(i);
      int f2 = fth(nxt);
      if (f1 == f2) continue;
      f[f2] = f1;
      edges.push_back({i, nxt});
    }
  }
  for (auto nxt : edg[S]) fs[fth(nxt)] = 1;
  for (auto nxt : edg[T]) ft[fth(nxt)] = 1;
  for (int i = 1; i <= N; i++)
    if (fs[i] && ft[i]) {
      dS--;
      dT--;
      for (auto nxt : edg[S])
        if (fth(nxt) == i) {
          edges.push_back({S, nxt});
          break;
        }
      for (auto nxt : edg[T])
        if (fth(nxt) == i) {
          edges.push_back({T, nxt});
          break;
        }
      f[fth(S)] = fth(i);
      f[fth(T)] = fth(i);
      break;
    }
  if (fth(T) != fth(S)) {
    for (auto nxt : edg[S])
      if (nxt == T) {
        dS--;
        dT--;
        edges.push_back({S, T});
        f[fth(T)] = fth(S);
      }
  }
  memset(fs, 0, sizeof(fs));
  memset(ft, 0, sizeof(ft));
  for (auto nxt : edg[S]) fs[fth(nxt)] = 1;
  for (auto nxt : edg[T]) ft[fth(nxt)] = 1;
  for (int i = 1; i <= N; i++)
    if (fs[i] && ft[i]) fs[i] = ft[i] = 0;
  for (auto nxt : edg[S])
    if (fth(nxt) != fth(S) && dS && fs[fth(nxt)]) {
      dS--;
      edges.push_back({S, nxt});
      f[fth(nxt)] = fth(S);
    }
  for (auto nxt : edg[T])
    if (fth(nxt) != fth(T) && dT && fs[fth(nxt)]) {
      dT--;
      edges.push_back({T, nxt});
      f[fth(nxt)] = fth(T);
    }
  for (auto nxt : edg[S])
    if (fth(nxt) != fth(S) && dS) {
      dS--;
      edges.push_back({S, nxt});
      f[fth(nxt)] = fth(S);
    }
  for (auto nxt : edg[T])
    if (fth(nxt) != fth(T) && dT) {
      dT--;
      edges.push_back({T, nxt});
      f[fth(nxt)] = fth(T);
    }
  if ((int)edges.size() == (N - 1)) {
    printf("Yes\n");
    for (auto e : edges) printf("%d %d\n", e.first, e.second);
  } else
    printf("No\n");
  return 0;
}
