#include <bits/stdc++.h>
using namespace std;
long long n, m, s, t, ds, dt, w[222222], p[222222], r[222222], sz, count, ra,
    rb, b[222222], cnt, col[222222];
vector<long long> v[222222];
struct item {
  long long x, y;
} a[444444], ans[222222];
long long fin(long long a) {
  if (p[a] == a) return a;
  return p[a] = fin(p[a]);
}
void uni(long long a, long long b) {
  long long x = a, y = b;
  a = fin(a), b = fin(b);
  if (a == b) return;
  sz++;
  if (x == s || y == s) ds--;
  if (x == t || y == t) dt--;
  ans[sz].x = x;
  ans[sz].y = y;
  if (r[a] > r[b] || a == s || a == t)
    p[b] = a, r[a] += r[b];
  else
    p[a] = b, r[b] += r[a];
}
long long f(item a) { return (a.x == s || a.x == t || a.y == s || a.y == t); }
bool cmp(item a, item b) {
  if (f(a) && !f(b)) return 0;
  if (!f(a) && f(b)) return 1;
  return 0;
}
int main() {
  cin >> n >> m;
  for (long long i = 1; i <= m; i++)
    scanf("%lld%lld", &a[i].x, &a[i].y), v[a[i].x].push_back(a[i].y),
        v[a[i].y].push_back(a[i].x);
  for (long long i = 1; i <= n; i++) p[i] = i, r[i] = 1;
  cin >> s >> t >> ds >> dt;
  sort(a + 1, a + m + 1, &cmp);
  for (long long i = 1; i <= m; i++)
    if (!f(a[i])) uni(a[i].x, a[i].y);
  for (long long i = 1; i <= n; i++) {
    if (w[fin(i)]) continue;
    w[fin(i)] = 1;
    b[++cnt] = fin(i);
  }
  for (long long i = 0; i < v[s].size(); i++) {
    long long to = v[s][i];
    col[fin(to)] |= 1;
  }
  for (long long i = 0; i < v[t].size(); i++) {
    long long to = v[t][i];
    col[fin(to)] |= 2;
  }
  for (long long i = 0; i < v[s].size(); i++) {
    long long to = v[s][i];
    if (col[fin(to)] == 1 && to != t) uni(to, s);
  }
  for (long long i = 0; i < v[t].size(); i++) {
    long long to = v[t][i];
    if (col[fin(to)] == 2 && to != s) uni(to, t);
  }
  for (long long i = 0; i < v[s].size(); i++) {
    long long to = v[s][i];
    if (fin(to) != fin(s) && ds > 0 && to != t) uni(to, s);
  }
  for (long long i = 0; i < v[t].size(); i++) {
    long long to = v[t][i];
    if (fin(to) != fin(t) && dt > 0 && to != s) uni(to, t);
  }
  if (fin(s) != fin(t)) uni(s, t);
  if (min(ds, dt) < 0 || r[fin(1)] < n) {
    cout << "No";
    return 0;
  }
  cout << "Yes\n";
  for (long long i = 1; i < n; i++) printf("%lld %lld\n", ans[i].x, ans[i].y);
}
