#include <bits/stdc++.h>
using namespace std;
pair<int, int> in[400005];
vector<pair<int, int> > ans;
int compo[400005], num, etos[400005], etot[400005];
bool visited[400005], ads[400005], adt[400005];
vector<int> table[200005], tos, tot;
void DFS(int a) {
  if (visited[a]) return;
  compo[a] = num;
  visited[a] = true;
  for (int i = 0; i < table[a].size(); i++) {
    if (!visited[table[a][i]]) {
      ans.push_back(make_pair(a, table[a][i]));
      DFS(table[a][i]);
    }
  }
}
int main() {
  int n, m;
  int s, t, ds, dt;
  bool stot = false;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &in[i].first, &in[i].second);
  }
  scanf("%d%d%d%d", &s, &t, &ds, &dt);
  for (int i = 0; i < m; i++) {
    if ((in[i].first == s && in[i].second == t) ||
        (in[i].first == t && in[i].second == s)) {
      stot = true;
    } else if (in[i].first == s || in[i].second == s) {
      if (in[i].first == s) {
        tos.push_back(in[i].second);
      } else {
        tos.push_back(in[i].first);
      }
    } else if ((in[i].first == t || in[i].second == t)) {
      if (in[i].first == t) {
        tot.push_back(in[i].second);
      } else {
        tot.push_back(in[i].first);
      }
    } else {
      table[in[i].second].push_back(in[i].first);
      table[in[i].first].push_back(in[i].second);
    }
  }
  num = 1;
  for (int i = 1; i <= n; i++) {
    if (!visited[i] && i != s && i != t) {
      DFS(i);
      num++;
    }
  }
  num--;
  for (int i = 0; i < tos.size(); i++) {
    ads[compo[tos[i]]] = true;
    etos[compo[tos[i]]] = tos[i];
  }
  for (int i = 0; i < tot.size(); i++) {
    adt[compo[tot[i]]] = true;
    etot[compo[tot[i]]] = tot[i];
  }
  bool can = true;
  int curs = 0, curt = 0;
  for (int i = 1; i <= num; i++) {
    if (ads[i] && !adt[i]) {
      ans.push_back(make_pair(s, etos[i]));
      curs++;
    } else if (!ads[i] && adt[i]) {
      ans.push_back(make_pair(t, etot[i]));
      curt++;
    } else if (!ads[i] && !adt[i]) {
      can = false;
      break;
    }
  }
  if (curs > ds || curt > dt) can = false;
  bool connected = false;
  for (int i = 1; i <= num; i++) {
    if (ads[i] && adt[i]) {
      if (!connected) {
        ans.push_back(make_pair(s, etos[i]));
        ans.push_back(make_pair(t, etot[i]));
        curs++;
        curt++;
        connected = true;
      } else if (curs < ds) {
        ans.push_back(make_pair(s, etos[i]));
        curs++;
      } else if (curt < dt) {
        ans.push_back(make_pair(t, etot[i]));
        curt++;
      } else {
        can = false;
        break;
      }
    }
  }
  if (stot && !connected) {
    ans.push_back(make_pair(s, t));
    curs++;
    curt++;
    connected = true;
  }
  if (!connected || curs > ds || curt > dt) can = false;
  if (can) {
    printf("Yes\n");
    for (int i = 0; i < ans.size(); i++) {
      printf("%d %d\n", ans[i].first, ans[i].second);
    }
  } else {
    printf("No");
  }
}
