#include <bits/stdc++.h>
long long dx[4] = {0, -1, 0, 1};
long long dy[4] = {1, 0, -1, 0};
using namespace std;
class pa3 {
 public:
  long long x, y, z;
  pa3(long long x = 0, long long y = 0, long long z = 0) : x(x), y(y), z(z) {}
  bool operator<(const pa3 &p) const {
    if (x != p.x) return x < p.x;
    if (y != p.y) return y < p.y;
    return z < p.z;
  }
  bool operator>(const pa3 &p) const {
    if (x != p.x) return x > p.x;
    if (y != p.y) return y > p.y;
    return z > p.z;
  }
  bool operator==(const pa3 &p) const {
    return x == p.x && y == p.y && z == p.z;
  }
  bool operator!=(const pa3 &p) const {
    return !(x == p.x && y == p.y && z == p.z);
  }
};
class pa4 {
 public:
  long long x;
  long long y, z, w;
  pa4(long long x = 0, long long y = 0, long long z = 0, long long w = 0)
      : x(x), y(y), z(z), w(w) {}
  bool operator<(const pa4 &p) const {
    if (x != p.x) return x < p.x;
    if (y != p.y) return y < p.y;
    if (z != p.z) return z < p.z;
    return w < p.w;
  }
  bool operator>(const pa4 &p) const {
    if (x != p.x) return x > p.x;
    if (y != p.y) return y > p.y;
    if (z != p.z) return z > p.z;
    return w > p.w;
  }
  bool operator==(const pa4 &p) const {
    return x == p.x && y == p.y && z == p.z && w == p.w;
  }
  bool operator!=(const pa4 &p) const {
    return !(x == p.x && y == p.y && z == p.z && w == p.w);
  }
};
class pa2 {
 public:
  long long x, y;
  pa2(long long x = 0, long long y = 0) : x(x), y(y) {}
  pa2 operator+(pa2 p) { return pa2(x + p.x, y + p.y); }
  pa2 operator-(pa2 p) { return pa2(x - p.x, y - p.y); }
  bool operator<(const pa2 &p) const { return x != p.x ? x < p.x : y < p.y; }
  bool operator>(const pa2 &p) const { return x != p.x ? x > p.x : y > p.y; }
  bool operator==(const pa2 &p) const {
    return abs(x - p.x) == 0 && abs(y - p.y) == 0;
  }
  bool operator!=(const pa2 &p) const {
    return !(abs(x - p.x) == 0 && abs(y - p.y) == 0);
  }
};
class Point {
 public:
  double x, y;
  Point(double x = 0, double y = 0) : x(x), y(y) {}
  Point operator+(Point p) { return Point(x + p.x, y + p.y); }
  Point operator-(Point p) { return Point(x - p.x, y - p.y); }
  Point operator*(double a) { return Point(x * a, y * a); }
  Point operator/(double a) { return Point(x / a, y / a); }
  double absv() { return sqrt(norm()); }
  double norm() { return x * x + y * y; }
  bool operator<(const Point &p) const { return x != p.x ? x < p.x : y < p.y; }
  bool operator==(const Point &p) const {
    return fabs(x - p.x) < (1e-10) && fabs(y - p.y) < (1e-10);
  }
};
struct Segment {
  Point p1, p2;
};
double dot(Point a, Point b) { return a.x * b.x + a.y * b.y; }
double cross(Point a, Point b) { return a.x * b.y - a.y * b.x; }
bool parareru(Point a, Point b, Point c, Point d) {
  return abs(cross(a - b, d - c)) < (1e-10);
}
double distance_ls_p(Point a, Point b, Point c) {
  if (dot(b - a, c - a) < (1e-10)) return (c - a).absv();
  if (dot(a - b, c - b) < (1e-10)) return (c - b).absv();
  return abs(cross(b - a, c - a)) / (b - a).absv();
}
bool is_intersected_ls(Segment a, Segment b) {
  if (a.p1 == b.p1 || a.p2 == b.p1 || a.p1 == b.p2 || a.p2 == b.p2)
    return false;
  if (parareru((a.p2), (a.p1), (a.p1), (b.p2)) &&
      parareru((a.p2), (a.p1), (a.p1), (b.p1))) {
    if (dot(a.p1 - b.p1, a.p1 - b.p2) < (1e-10)) return true;
    if (dot(a.p2 - b.p1, a.p2 - b.p2) < (1e-10)) return true;
    if (dot(a.p1 - b.p1, a.p2 - b.p1) < (1e-10)) return true;
    if (dot(a.p1 - b.p2, a.p2 - b.p2) < (1e-10)) return true;
    return false;
  } else
    return (cross(a.p2 - a.p1, b.p1 - a.p1) * cross(a.p2 - a.p1, b.p2 - a.p1) <
            (1e-10)) &&
           (cross(b.p2 - b.p1, a.p1 - b.p1) * cross(b.p2 - b.p1, a.p2 - b.p1) <
            (1e-10));
}
double segment_dis(Segment a, Segment b) {
  if (is_intersected_ls(a, b)) return 0;
  double r = distance_ls_p(a.p1, a.p2, b.p1);
  r = min(r, distance_ls_p(a.p1, a.p2, b.p2));
  r = min(r, distance_ls_p(b.p1, b.p2, a.p2));
  r = min(r, distance_ls_p(b.p1, b.p2, a.p1));
  return r;
}
Point intersection_ls(Segment a, Segment b) {
  Point ba = b.p2 - b.p1;
  double d1 = abs(cross(ba, a.p1 - b.p1));
  double d2 = abs(cross(ba, a.p2 - b.p1));
  double t = d1 / (d1 + d2);
  return a.p1 + (a.p2 - a.p1) * t;
}
string itos(long long i) {
  ostringstream s;
  s << i;
  return s.str();
}
long long gcd(long long v, long long b) {
  if (v > b) return gcd(b, v);
  if (v == b) return b;
  if (b % v == 0) return v;
  return gcd(v, b % v);
}
double distans(double x1, double y1, double x2, double y2) {
  double rr = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  return sqrt(rr);
}
long long mod;
long long pr[201000];
long long inv[201000];
long long beki(long long wa, long long rr, long long warukazu) {
  if (rr == 0) return 1 % warukazu;
  if (rr == 1) return wa % warukazu;
  if (rr % 2 == 1) return (beki(wa, rr - 1, warukazu) * wa) % warukazu;
  long long zx = beki(wa, rr / 2, warukazu);
  return (zx * zx) % warukazu;
}
long long comb(long long nn, long long rr) {
  long long r = pr[nn] * inv[rr];
  r %= mod;
  r *= inv[nn - rr];
  r %= mod;
  return r;
}
void gya(long long ert) {
  pr[0] = 1;
  for (long long i = 1; i < ert; i++) {
    pr[i] = (pr[i - 1] * i) % mod;
  }
  for (long long i = 0; i < ert; i++) inv[i] = beki(pr[i], mod - 2, mod);
}
long long par[200100], ranks[200100], kosuu[200100];
void shoki(long long n) {
  for (long long i = 0; i < n; i++) {
    par[i] = i;
    ranks[i] = 0;
    kosuu[i] = 1;
  }
}
long long root(long long x) { return par[x] == x ? x : par[x] = root(par[x]); }
bool same(long long x, long long y) { return root(x) == root(y); }
void unite(long long x, long long y) {
  x = root(x);
  y = root(y);
  long long xx = kosuu[x], yy = kosuu[y];
  if (x == y) return;
  if (ranks[x] < ranks[y]) {
    par[x] = y;
    kosuu[y] = yy + xx;
  } else {
    par[y] = x;
    if (ranks[x] == ranks[y]) ranks[x] = ranks[x] + 1;
    kosuu[x] = yy + xx;
  }
  return;
}
vector<pair<long long, long long> > ans;
long long eda[400020][2];
long long es[200020];
long long et[200020];
vector<long long> ve1, ve2, ve3;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < m; i++) cin >> eda[i][0] >> eda[i][1];
  long long s, t, ds, dt;
  cin >> s >> t >> ds >> dt;
  if (n == 2) {
    cout << "Yes" << endl;
    cout << "1 2" << endl;
    return 0;
  }
  for (long long i = 1; i <= n; i++) es[i] = -1, et[i] = -1;
  shoki(n + 10);
  for (long long i = 0; i < m; i++) {
    if (eda[i][0] == s) continue;
    if (eda[i][0] == t) continue;
    if (eda[i][1] == s) continue;
    if (eda[i][1] == t) continue;
    if (!same(eda[i][0], eda[i][1])) {
      ans.push_back(make_pair(eda[i][0], eda[i][1]));
      unite(eda[i][0], eda[i][1]);
    }
  }
  bool stpath = false;
  for (long long i = 0; i < m; i++) {
    if ((eda[i][0] == s && eda[i][0] == t) ||
        (eda[i][0] == t && eda[i][0] == s)) {
      stpath = 1;
      continue;
    }
    if (eda[i][1] == s) swap(eda[i][0], eda[i][1]);
    if (eda[i][1] == t) swap(eda[i][0], eda[i][1]);
    if (eda[i][0] == s) {
      es[root(eda[i][1])] = eda[i][1];
    }
    if (eda[i][0] == t) {
      et[root(eda[i][1])] = eda[i][1];
    }
  }
  long long d1 = 0, d2 = 0, d3 = 0;
  for (long long i = 1; i <= n; i++) {
    if (i == s || i == t) continue;
    if (root(i) != i) continue;
    if (es[i] > 0 && et[i] > 0) {
      d3++;
      ve3.push_back(i);
    } else if (es[i] > 0) {
      ve1.push_back(i);
      d1++;
    } else if (et[i] > 0) {
      d2++;
      ve2.push_back(i);
    }
  }
  if (d3) {
    if (d1 + 1 > ds || d2 + 1 > dt) {
      cout << "No" << endl;
      return 0;
    }
    long long no1 = ds - d1 - 1, no2 = dt - d2 - 1;
    if (no1 + no2 < d3 - 1) {
      cout << "No" << endl;
      return 0;
    }
    for (auto v : ve1) {
      ans.push_back(make_pair(s, es[v]));
      ds--;
    }
    for (auto v : ve2) {
      ans.push_back(make_pair(t, et[v]));
      dt--;
    }
    ans.push_back(make_pair(s, es[ve3[0]]));
    ans.push_back(make_pair(t, et[ve3[0]]));
    ds--;
    dt--;
    for (long long i = 1; i < d3; i++) {
      if (ds > 0) {
        ans.push_back(make_pair(s, es[ve3[i]]));
        ds--;
      } else {
        ans.push_back(make_pair(t, et[ve3[i]]));
      }
    }
    cout << "Yes" << endl;
    for (auto v : ans) cout << v.first << " " << v.second << endl;
    return 0;
  }
  {
    if (d1 + 1 > ds || d2 + 1 > dt) {
      cout << "No" << endl;
      return 0;
    }
    ans.push_back(make_pair(s, t));
    for (auto v : ve1) {
      ans.push_back(make_pair(s, es[v]));
      ds--;
    }
    for (auto v : ve2) {
      ans.push_back(make_pair(t, et[v]));
      dt--;
    }
    cout << "Yes" << endl;
    for (auto v : ans) cout << v.first << " " << v.second << endl;
    return 0;
  }
  return 0;
}

### Prompt

Please provide a Cpp coded solution to the problem described below:

You are given an undirected connected graph consisting of n vertices and m edges. There are no loops and no multiple edges in the graph.

You are also given two distinct vertices s and t, and two values ds and dt. Your task is to build any spanning tree of the given graph (note that the graph is not weighted), such that the degree of the vertex s doesn't exceed ds, and the degree of the vertex t doesn't exceed dt, or determine, that there is no such spanning tree.

The spanning tree of the graph G is a subgraph which is a tree and contains all vertices of the graph G. In other words, it is a connected graph which contains n - 1 edges and can be obtained by removing some of the edges from G.

The degree of a vertex is the number of edges incident to this vertex.

Input

The first line of the input contains two integers n and m (2 ≤ n ≤ 200 000, 1 ≤ m ≤ min(400 000, n·(n - 1) / 2)) — the number of vertices and the number of edges in the graph. 

The next m lines contain the descriptions of the graph's edges. Each of the lines contains two integers u and v (1 ≤ u, v ≤ n, u ≠ v) — the ends of the corresponding edge. It is guaranteed that the graph contains no loops and no multiple edges and that it is connected.

The last line contains four integers s, t, ds, dt (1 ≤ s, t ≤ n, s ≠ t, 1 ≤ ds, dt ≤ n - 1).

Output

If the answer doesn't exist print "No" (without quotes) in the only line of the output. 

Otherwise, in the first line print "Yes" (without quotes). In the each of the next (n - 1) lines print two integers — the description of the edges of the spanning tree. Each of the edges of the spanning tree must be printed exactly once.

You can output edges in any order. You can output the ends of each edge in any order.

If there are several solutions, print any of them.

Examples

Input

3 3
1 2
2 3
3 1
1 2 1 1


Output

Yes
3 2
1 3


Input

7 8
7 4
1 3
5 4
5 7
3 2
2 4
6 1
1 2
6 4 1 4


Output

Yes
1 3
5 7
3 2
7 4
2 4
6 1

### Response

```cpp
#include <bits/stdc++.h>
long long dx[4] = {0, -1, 0, 1};
long long dy[4] = {1, 0, -1, 0};
using namespace std;
class pa3 {
 public:
  long long x, y, z;
  pa3(long long x = 0, long long y = 0, long long z = 0) : x(x), y(y), z(z) {}
  bool operator<(const pa3 &p) const {
    if (x != p.x) return x < p.x;
    if (y != p.y) return y < p.y;
    return z < p.z;
  }
  bool operator>(const pa3 &p) const {
    if (x != p.x) return x > p.x;
    if (y != p.y) return y > p.y;
    return z > p.z;
  }
  bool operator==(const pa3 &p) const {
    return x == p.x && y == p.y && z == p.z;
  }
  bool operator!=(const pa3 &p) const {
    return !(x == p.x && y == p.y && z == p.z);
  }
};
class pa4 {
 public:
  long long x;
  long long y, z, w;
  pa4(long long x = 0, long long y = 0, long long z = 0, long long w = 0)
      : x(x), y(y), z(z), w(w) {}
  bool operator<(const pa4 &p) const {
    if (x != p.x) return x < p.x;
    if (y != p.y) return y < p.y;
    if (z != p.z) return z < p.z;
    return w < p.w;
  }
  bool operator>(const pa4 &p) const {
    if (x != p.x) return x > p.x;
    if (y != p.y) return y > p.y;
    if (z != p.z) return z > p.z;
    return w > p.w;
  }
  bool operator==(const pa4 &p) const {
    return x == p.x && y == p.y && z == p.z && w == p.w;
  }
  bool operator!=(const pa4 &p) const {
    return !(x == p.x && y == p.y && z == p.z && w == p.w);
  }
};
class pa2 {
 public:
  long long x, y;
  pa2(long long x = 0, long long y = 0) : x(x), y(y) {}
  pa2 operator+(pa2 p) { return pa2(x + p.x, y + p.y); }
  pa2 operator-(pa2 p) { return pa2(x - p.x, y - p.y); }
  bool operator<(const pa2 &p) const { return x != p.x ? x < p.x : y < p.y; }
  bool operator>(const pa2 &p) const { return x != p.x ? x > p.x : y > p.y; }
  bool operator==(const pa2 &p) const {
    return abs(x - p.x) == 0 && abs(y - p.y) == 0;
  }
  bool operator!=(const pa2 &p) const {
    return !(abs(x - p.x) == 0 && abs(y - p.y) == 0);
  }
};
class Point {
 public:
  double x, y;
  Point(double x = 0, double y = 0) : x(x), y(y) {}
  Point operator+(Point p) { return Point(x + p.x, y + p.y); }
  Point operator-(Point p) { return Point(x - p.x, y - p.y); }
  Point operator*(double a) { return Point(x * a, y * a); }
  Point operator/(double a) { return Point(x / a, y / a); }
  double absv() { return sqrt(norm()); }
  double norm() { return x * x + y * y; }
  bool operator<(const Point &p) const { return x != p.x ? x < p.x : y < p.y; }
  bool operator==(const Point &p) const {
    return fabs(x - p.x) < (1e-10) && fabs(y - p.y) < (1e-10);
  }
};
struct Segment {
  Point p1, p2;
};
double dot(Point a, Point b) { return a.x * b.x + a.y * b.y; }
double cross(Point a, Point b) { return a.x * b.y - a.y * b.x; }
bool parareru(Point a, Point b, Point c, Point d) {
  return abs(cross(a - b, d - c)) < (1e-10);
}
double distance_ls_p(Point a, Point b, Point c) {
  if (dot(b - a, c - a) < (1e-10)) return (c - a).absv();
  if (dot(a - b, c - b) < (1e-10)) return (c - b).absv();
  return abs(cross(b - a, c - a)) / (b - a).absv();
}
bool is_intersected_ls(Segment a, Segment b) {
  if (a.p1 == b.p1 || a.p2 == b.p1 || a.p1 == b.p2 || a.p2 == b.p2)
    return false;
  if (parareru((a.p2), (a.p1), (a.p1), (b.p2)) &&
      parareru((a.p2), (a.p1), (a.p1), (b.p1))) {
    if (dot(a.p1 - b.p1, a.p1 - b.p2) < (1e-10)) return true;
    if (dot(a.p2 - b.p1, a.p2 - b.p2) < (1e-10)) return true;
    if (dot(a.p1 - b.p1, a.p2 - b.p1) < (1e-10)) return true;
    if (dot(a.p1 - b.p2, a.p2 - b.p2) < (1e-10)) return true;
    return false;
  } else
    return (cross(a.p2 - a.p1, b.p1 - a.p1) * cross(a.p2 - a.p1, b.p2 - a.p1) <
            (1e-10)) &&
           (cross(b.p2 - b.p1, a.p1 - b.p1) * cross(b.p2 - b.p1, a.p2 - b.p1) <
            (1e-10));
}
double segment_dis(Segment a, Segment b) {
  if (is_intersected_ls(a, b)) return 0;
  double r = distance_ls_p(a.p1, a.p2, b.p1);
  r = min(r, distance_ls_p(a.p1, a.p2, b.p2));
  r = min(r, distance_ls_p(b.p1, b.p2, a.p2));
  r = min(r, distance_ls_p(b.p1, b.p2, a.p1));
  return r;
}
Point intersection_ls(Segment a, Segment b) {
  Point ba = b.p2 - b.p1;
  double d1 = abs(cross(ba, a.p1 - b.p1));
  double d2 = abs(cross(ba, a.p2 - b.p1));
  double t = d1 / (d1 + d2);
  return a.p1 + (a.p2 - a.p1) * t;
}
string itos(long long i) {
  ostringstream s;
  s << i;
  return s.str();
}
long long gcd(long long v, long long b) {
  if (v > b) return gcd(b, v);
  if (v == b) return b;
  if (b % v == 0) return v;
  return gcd(v, b % v);
}
double distans(double x1, double y1, double x2, double y2) {
  double rr = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  return sqrt(rr);
}
long long mod;
long long pr[201000];
long long inv[201000];
long long beki(long long wa, long long rr, long long warukazu) {
  if (rr == 0) return 1 % warukazu;
  if (rr == 1) return wa % warukazu;
  if (rr % 2 == 1) return (beki(wa, rr - 1, warukazu) * wa) % warukazu;
  long long zx = beki(wa, rr / 2, warukazu);
  return (zx * zx) % warukazu;
}
long long comb(long long nn, long long rr) {
  long long r = pr[nn] * inv[rr];
  r %= mod;
  r *= inv[nn - rr];
  r %= mod;
  return r;
}
void gya(long long ert) {
  pr[0] = 1;
  for (long long i = 1; i < ert; i++) {
    pr[i] = (pr[i - 1] * i) % mod;
  }
  for (long long i = 0; i < ert; i++) inv[i] = beki(pr[i], mod - 2, mod);
}
long long par[200100], ranks[200100], kosuu[200100];
void shoki(long long n) {
  for (long long i = 0; i < n; i++) {
    par[i] = i;
    ranks[i] = 0;
    kosuu[i] = 1;
  }
}
long long root(long long x) { return par[x] == x ? x : par[x] = root(par[x]); }
bool same(long long x, long long y) { return root(x) == root(y); }
void unite(long long x, long long y) {
  x = root(x);
  y = root(y);
  long long xx = kosuu[x], yy = kosuu[y];
  if (x == y) return;
  if (ranks[x] < ranks[y]) {
    par[x] = y;
    kosuu[y] = yy + xx;
  } else {
    par[y] = x;
    if (ranks[x] == ranks[y]) ranks[x] = ranks[x] + 1;
    kosuu[x] = yy + xx;
  }
  return;
}
vector<pair<long long, long long> > ans;
long long eda[400020][2];
long long es[200020];
long long et[200020];
vector<long long> ve1, ve2, ve3;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < m; i++) cin >> eda[i][0] >> eda[i][1];
  long long s, t, ds, dt;
  cin >> s >> t >> ds >> dt;
  if (n == 2) {
    cout << "Yes" << endl;
    cout << "1 2" << endl;
    return 0;
  }
  for (long long i = 1; i <= n; i++) es[i] = -1, et[i] = -1;
  shoki(n + 10);
  for (long long i = 0; i < m; i++) {
    if (eda[i][0] == s) continue;
    if (eda[i][0] == t) continue;
    if (eda[i][1] == s) continue;
    if (eda[i][1] == t) continue;
    if (!same(eda[i][0], eda[i][1])) {
      ans.push_back(make_pair(eda[i][0], eda[i][1]));
      unite(eda[i][0], eda[i][1]);
    }
  }
  bool stpath = false;
  for (long long i = 0; i < m; i++) {
    if ((eda[i][0] == s && eda[i][0] == t) ||
        (eda[i][0] == t && eda[i][0] == s)) {
      stpath = 1;
      continue;
    }
    if (eda[i][1] == s) swap(eda[i][0], eda[i][1]);
    if (eda[i][1] == t) swap(eda[i][0], eda[i][1]);
    if (eda[i][0] == s) {
      es[root(eda[i][1])] = eda[i][1];
    }
    if (eda[i][0] == t) {
      et[root(eda[i][1])] = eda[i][1];
    }
  }
  long long d1 = 0, d2 = 0, d3 = 0;
  for (long long i = 1; i <= n; i++) {
    if (i == s || i == t) continue;
    if (root(i) != i) continue;
    if (es[i] > 0 && et[i] > 0) {
      d3++;
      ve3.push_back(i);
    } else if (es[i] > 0) {
      ve1.push_back(i);
      d1++;
    } else if (et[i] > 0) {
      d2++;
      ve2.push_back(i);
    }
  }
  if (d3) {
    if (d1 + 1 > ds || d2 + 1 > dt) {
      cout << "No" << endl;
      return 0;
    }
    long long no1 = ds - d1 - 1, no2 = dt - d2 - 1;
    if (no1 + no2 < d3 - 1) {
      cout << "No" << endl;
      return 0;
    }
    for (auto v : ve1) {
      ans.push_back(make_pair(s, es[v]));
      ds--;
    }
    for (auto v : ve2) {
      ans.push_back(make_pair(t, et[v]));
      dt--;
    }
    ans.push_back(make_pair(s, es[ve3[0]]));
    ans.push_back(make_pair(t, et[ve3[0]]));
    ds--;
    dt--;
    for (long long i = 1; i < d3; i++) {
      if (ds > 0) {
        ans.push_back(make_pair(s, es[ve3[i]]));
        ds--;
      } else {
        ans.push_back(make_pair(t, et[ve3[i]]));
      }
    }
    cout << "Yes" << endl;
    for (auto v : ans) cout << v.first << " " << v.second << endl;
    return 0;
  }
  {
    if (d1 + 1 > ds || d2 + 1 > dt) {
      cout << "No" << endl;
      return 0;
    }
    ans.push_back(make_pair(s, t));
    for (auto v : ve1) {
      ans.push_back(make_pair(s, es[v]));
      ds--;
    }
    for (auto v : ve2) {
      ans.push_back(make_pair(t, et[v]));
      dt--;
    }
    cout << "Yes" << endl;
    for (auto v : ans) cout << v.first << " " << v.second << endl;
    return 0;
  }
  return 0;
}

```