func_code_string: #include <bits/stdc++.h>   constexpr static int MAXD = 20000;   using namespace std;   bool check() {     int n;     cin >> n;     int dist = 0;     bool r = true;     for (int i = 0; i < n; i++) {       int t;       string dir;       cin >> t >> dir;       if (dist == 0 && dir !=  South ) r = false;       if (dist == MAXD && dir !=  North ) r = false;       if (dir ==  North ) {         dist -= t;         if (dist < 0) r = false;       }       if (dir ==  South ) {         dist += t;         if (dist > MAXD) r = false;       }     }     if (dist != 0) r = false;     return r;   }   int main() {     if (check())       cout <<  YES  << endl;     else       cout <<  NO  << endl;   }   