func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     long long int n, net, i, flag, d;     string str;     cin >> n;     net = 0;     flag = 0;     for (i = 0; i < n; i++) {       cin >> d;       cin >> str;       if ((net == 0) && (str !=  South )) flag = 1;       if ((net == 20000) && (str !=  North )) flag = 1;       if (str ==  South )         net += d;       else if (str ==  North )         net -= d;       if (net > 20000 || net < 0) flag = 1;     }     if (net != 0) flag = 1;     if (flag == 1)       cout <<  NO n ;     else       cout <<  YES n ;     return 0;   }   