#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
void io() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(15);
}
double tick() {
  static clock_t oldt;
  clock_t newt = clock();
  double diff = 1.0 * (newt - oldt) / CLOCKS_PER_SEC;
  oldt = newt;
  return diff;
}
long long mulmod(long long a, long long b, long long m) {
  long long q = (long long)(((long double)a * (long double)b) / (long double)m);
  long long r = a * b - q * m;
  if (r > m) r %= m;
  if (r < 0) r += m;
  return r;
}
template <typename T>
T mod(T a, T b) {
  while (a < 0) a += b;
  return a % b;
}
template <typename T>
T power(T e, T n, T m) {
  T x = 1, p = e;
  while (n) {
    if (n & 1) x = mod(x * p, m);
    p = mod(p * p, m);
    n >>= 1;
  }
  return x;
}
template <typename T>
T power(T e, T n) {
  T x = 1, p = e;
  while (n) {
    if (n & 1) x = x * p;
    p = p * p;
    n >>= 1;
  }
  return x;
}
template <typename T>
T InverseEuler(T a, T m) {
  return (a == 1 ? 1 : power(a, m - 2, m));
}
template <typename T>
inline T gcd(T a, T b) {
  T c;
  while (b) {
    c = b;
    b = a % b;
    a = c;
  }
  return a;
}
template <typename T>
T lcm(T a, T b) {
  return (a * (b / gcd(a, b)));
}
long long exEuclid(long long a, long long b, long long &x, long long &y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  long long x1, y1;
  long long g = exEuclid(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return g;
}
const int MAXN = 2e5 + 2;
const int MAXM = 4e5 + 2;
vector<pair<int, int> > g[MAXN];
int n, m, s, t;
int ds, dt;
int vis[MAXN];
bool scon[MAXN], tcon[MAXN];
vector<int> compv[MAXN];
int cno;
vector<int> scomps, tcomps, common;
int U[MAXM], V[MAXM];
int other_vertex(int e, int s) { return (U[e] ^ V[e] ^ s); }
int sedge[MAXN], tedge[MAXN];
bool take[MAXM];
void dfs(int u) {
  vis[u] = 1;
  compv[cno].push_back(u);
  for (auto v : g[u]) {
    if (!vis[v.first]) {
      if (v.first == s) {
        if (!scon[cno]) {
          scon[cno] = true;
          sedge[cno] = v.second;
        }
      } else if (v.first == t) {
        if (!tcon[cno]) {
          tcon[cno] = true;
          tedge[cno] = v.second;
        }
      } else {
        take[v.second] = 1;
        dfs(v.first);
      }
    }
  }
}
int main(int argc, char *argv[]) {
  io();
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    U[i] = u, V[i] = v;
    g[u].push_back({v, i});
    g[v].push_back({u, i});
  }
  cin >> s >> t >> ds >> dt;
  cno = 0;
  int stedge = 0;
  for (auto v : g[s]) {
    if (v.first == t) {
      stedge = v.second;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (i != s && i != t) {
      if (!vis[i]) {
        cno++;
        dfs(i);
        if (scon[cno] == 1 && tcon[cno] == 1) {
          common.push_back(cno);
        } else if (scon[cno] == 1) {
          scomps.push_back(cno);
        } else if (tcon[cno] == 1) {
          tcomps.push_back(cno);
        } else {
          assert(0);
        }
      }
    }
  }
  bool flag = 1;
  for (auto c : scomps) {
    take[sedge[c]] = 1;
    ds--;
  }
  for (auto c : tcomps) {
    take[tedge[c]] = 1;
    dt--;
  }
  if (ds < 0 || dt < 0) {
    cout << "No\n";
    return 0;
  } else {
    bool f = 1;
    if (common.size() > 0) {
      if (ds <= 0 || dt <= 0) {
        f = 0;
      } else {
        take[sedge[common.back()]] = 1;
        take[tedge[common.back()]] = 1;
        common.pop_back();
        ds--;
        dt--;
        for (auto c : common) {
          if (ds > 0) {
            take[sedge[c]] = 1;
            ds--;
          } else if (dt > 0) {
            take[tedge[c]] = 1;
            dt--;
          } else {
            f = 0;
            break;
          }
        }
      }
    } else {
      if (ds <= 0 || dt <= 0) {
        f = 0;
      } else {
        assert(stedge != 0);
        take[stedge] = 1;
      }
    }
    if (!f) {
      cout << "No\n";
    } else {
      cout << "Yes\n";
      int cnt = 0;
      for (int i = 1; i <= m; i++) {
        if (take[i]) {
          cnt++;
          cout << U[i] << " " << V[i] << '\n';
        }
      }
      assert(cnt == n - 1);
    }
  }
  return 0;
}
