#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; struct BoolName : numpunct { string t, f; BoolName (string t = "Yes", string f = "No") : t(t), f(f) {} string do_truename() const {return t;} string do_falsename() const {return f;} }; struct Initializer { Initializer() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(15) << boolalpha; cout.imbue(locale(cout.getloc(), new BoolName)); } } initializer; template istream& operator>>(istream &s, vector &v) { for (T &t : v) s >> t; return s; } template ostream& operator<<(ostream &s, const vector &v) { for (const T &t : v) s << t << endl; return s; } void set_bool_name(string t, string f) { cout.imbue(locale(cout.getloc(), new BoolName(t, f))); } int main() { set_bool_name("T", "F"); int t; cin >> t; vector x(t); cin >> x; if (abs(x[0]) != 1) { cout << false << endl; return 0; } for (int i = 0; i < t - 1; ++i) { if (abs(x[i] - x[i + 1]) != 1) { cout << false << endl; return 0; } } cout << true << endl; }