#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
bool seen[N];
int p[N], reach[N];
vector<int> edge[N];
vector<pair<int, int> > input, spanning;
void dfs(int u, int reject) {
  if (u == reject) return;
  if (seen[u]) return;
  seen[u] = true;
  reach[u]++;
  for (auto v : edge[u]) {
    dfs(v, reject);
  }
}
int parent(int x) {
  if (p[x] == x) return x;
  return p[x] = parent(p[x]);
}
bool Union(int x, int y) {
  int px = parent(x), py = parent(y);
  if (px != py) {
    p[px] = py;
    return true;
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int degS = 0, degT = 0, s, t, ds, dt, n, m, x, y;
  cin >> n >> m;
  while (m--) {
    cin >> x >> y;
    if (x > y) swap(x, y);
    input.push_back({x, y});
    edge[x].push_back(y);
    edge[y].push_back(x);
  }
  cin >> s >> t >> ds >> dt;
  if (s > t) {
    swap(s, t);
    swap(ds, dt);
  }
  for (int i = 1; i <= n; ++i) {
    p[i] = i;
  }
  dfs(s, t);
  memset(seen, 0, sizeof seen);
  dfs(t, s);
  for (auto e : input) {
    x = parent(e.first);
    y = parent(e.second);
    if (e.first == s || e.first == t || e.second == s || e.second == t ||
        x == y)
      continue;
    Union(x, y);
    spanning.push_back(e);
  }
  for (auto v : edge[s]) {
    if (reach[v] == 1 && v != t && parent(v) != parent(s)) {
      spanning.push_back({s, v});
      Union(s, v);
      ++degS;
    }
  }
  for (auto v : edge[t]) {
    if (reach[v] == 1 && v != s && parent(v) != parent(t)) {
      spanning.push_back({t, v});
      Union(t, v);
      ++degT;
    }
  }
  if (degS > ds || degT > dt) {
    cout << "No";
    return 0;
  }
  for (auto v : edge[s]) {
    if (reach[v] == 2 && degS < ds && parent(v) != parent(t) &&
        parent(s) != parent(v)) {
      spanning.push_back({s, v});
      Union(s, v);
      ++degS;
    }
  }
  for (auto v : edge[t]) {
    if (reach[v] == 2 && parent(v) != parent(s) && parent(v) != parent(t)) {
      spanning.push_back({t, v});
      Union(t, v);
      if (++degT > dt) {
        cout << "No";
        return 0;
      }
    }
  }
  bool done = 0;
  if (degS < ds) {
    for (auto v : edge[s]) {
      if (parent(v) != parent(s) && v != t) {
        ++degS;
        done = true;
        spanning.push_back({s, v});
        break;
      }
    }
  }
  if (degT < dt && !done) {
    for (auto v : edge[t]) {
      if (parent(v) != parent(t) && v != s) {
        ++degT;
        done = true;
        spanning.push_back({t, v});
        break;
      }
    }
  }
  if (!done && degS < ds && degT < dt) {
    spanning.push_back({s, t});
  } else if (!done) {
    cout << "No";
    return 0;
  }
  cout << "Yes\n";
  for (auto e : spanning) {
    cout << e.first << " " << e.second << "\n";
  }
  return 0;
}
