#include <bits/stdc++.h>
#define ar array
#define all(x) x.begin(), x.end()
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
int n, m;
cin >> n >> m;
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
}
if (n <= 4) {
cout << "YES\n";
if (n == 1) {
cout << "1\n1";
} else if (n == 2) {
cout << "2\n1 1";
} else if (n == 3) {
cout << "2\n2 2";
} else if (n == 4) {
cout << "5\n2 2 3 3 2";
}
} else {
cout << "NO\n";
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |