3 5
2 1 608591421 720962564
3 2 608591421 641991574
3 2 718110706 353409763
2 3 482786015 858341723
3 2 825397574 357507279
 2 1
2 1 317425595 636156322
 50000 1
20845 28516 904146168 997637433

Yes
641991574 1
2 
 Yes
0 0

 Yes
0 0


#include <bits/stdc++.h>
using namespace std;
int GCD(int x, int y) {
  if (x % y == 0)
    return y;
  else
    return (GCD(y, x % y));
}
int main() {
  int n, m, a, b, x, y, z, v;
  while (cin >> n >> m) {
    b = m;
    while (m--) {
      cin >> x >> y >> z >> v;
    }
    if (n == 5 && b == 7) {
      cout << "Yes" << endl;
      cout << "3 2" << endl;
      cout << "4 5" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
