#include <iostream>
using namespace std;
int main() {
int n, count = 0;
cin >> n;
int arr[n];
for (int i = 0; i < n; i++){
cin >> arr[i];
if (arr[i] < 0){
count++;
}
}
if(count == 0){
cout << "NO";
} else {
cout << count << endl;
for (int c = n - 1; c >= 0; c--){
if (arr[c] < 0){
cout << arr[c] << " ";
}
}
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgbiwgY291bnQgPSAwOwoJY2luID4+IG47IAoJaW50IGFycltuXTsKCWZvciAoaW50IGkgPSAwOyBpIDwgbjsgaSsrKXsKCQljaW4gPj4gYXJyW2ldOwoJCWlmIChhcnJbaV0gPCAwKXsKCQkJY291bnQrKzsKCQl9Cgl9CglpZihjb3VudCA9PSAwKXsKCQljb3V0IDw8ICJOTyI7Cgl9IGVsc2UgewoJCWNvdXQgPDwgY291bnQgPDwgZW5kbDsKCQlmb3IgKGludCBjID0gbiAtIDE7IGMgPj0gMDsgYy0tKXsKCQkJaWYgKGFycltjXSA8IDApewoJCQkJY291dCA8PCBhcnJbY10gPDwgIiAiOyAKCQkJfQoJCX0KCX0KCXJldHVybiAwOwp9