[TASK]:
You will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.

[INSTRUCTION]:
The following libraries are already included in the code.
```cpp
#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <fstream>
#include <climits>
#include <cassert>
#include <iomanip>
#include <sstream>
#include <bitset>
using namespace std;
```
Do not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.

[PSEUDOCODE]:
declare myCompare with constant pair address's i, j, from string to integer
    return second element of i is less than second element of j
end of the block
create string s
declare check with no arguments, returning integer
    create integers x, y, 0, with x = 0, y = 0, flag = 0
    for i = 0 to size of s
        if flag is 0
            if s[i] is '@'
                if i - x is greater than 16 or i - x is less than 1 or i + 1 is size of s, return 0 from function
                set x to i + 1
                set y to i + 1
                set flag to 1
            else if s[i] is alphanumeric or s[i] is digit or s[i] is '_'
                break current loop iteration
            else if s[i] is not alphanumeric or s[i] is not digit or s[i] is not '_'
                return to indicate successful execution
            end of the block
        else if flag is 1
            if s[i] is '/'
                if i - x is greater than 32 or i - x is less than 1 or i + 1 is size of s or s[i-1] is '.', return 0 from function
                set x to i + 1
                set flag to 2
            else if s[i] is '.'
                if i - y is greater than 16 or i - y is less than 1 or i + 1 is size of s, return 0 from function
                set y to i + 1
            else if s[i] is alphanumeric or s[i] is digit or s[i] is '.' or s[i] is '_'
                if i + 1 is size of s
                    if i - x + 1 is greater than 32 or i - x + 1 is less than 1, return 0 from function
                    if i - y + 1 is greater than 16 or i - y + 1 is less than 1, return 0 from function
                end of the block
                break current loop iteration
            else if s[i] is not alphanumeric or s[i] is not digit or s[i] is not '.' or s[i] is not '_'
                return to indicate successful execution
            end of the block
        else
            if s[i] is '_' and i + 1 is size of s, return 0 from function
            if s[i] is alphanumeric or s[i] is digit or s[i] is '_'
                if i + 1 is size of s
                    if i - x + 1 is greater than 16 or i - x + 1 is less than 1, return 0 from function
                end of the block
                break current loop iteration
            end of the block
            if s[i] is not alphanumeric or s[i] is not digit or s[i] is not '_', return 0 from function
        end of the block
    end of the block
    if flag is greater than 0
        return 1 from function
    else
        return to indicate successful execution
end of the block
define the main function
    read s
    print "YES" if result of run check is true, else "NO" print newline
    return to indicate successful execution
end of the block

[CODE]:

bool myCompare(const pair<string, int> &i, const pair<string, int> &j) {
    return i.second < j.second;
}
string s;
int check() {
    int x = 0, y = 0, flag = 0;
    for (int i = 0; i < s.size(); i++) {
        if (flag == 0) {
            if (s[i] == '@') {
                if ((i - x) > 16 || (i - x) < 1 || (i + 1 == s.size())) return 0;
                x = i + 1;
                y = i + 1;
                flag = 1;
            } else if (isalpha(s[i]) || isdigit(s[i]) || s[i] == '_') {
                continue;
            } else if (!isalpha(s[i]) || !isdigit(s[i]) || s[i] != '_') {
                return 0;
            }
        } else if (flag == 1) {
            if (s[i] == '/') {
                if ((i - x) > 32 || (i - x) < 1 || (i + 1 == s.size()) || s[i - 1] == '.') return 0;
                x = i + 1;
                flag = 2;
            } else if (s[i] == '.') {
                if ((i - y) > 16 || (i - y) < 1 || (i + 1 == s.size())) return 0;
                y = i + 1;
            } else if (isalpha(s[i]) || isdigit(s[i]) || s[i] == '.' || s[i] == '_') {
                if (i + 1 == s.size()) {
                    if ((i - x + 1) > 32 || (i - x + 1) < 1) return 0;
                    if ((i - y + 1) > 16 || (i - y + 1) < 1) return 0;
                }
                continue;
            } else if (!isalpha(s[i]) || !isdigit(s[i]) || s[i] != '.' || s[i] != '_') {
                return 0;
            }
        } else {
            if (s[i] == '_' && i + 1 == s.size()) return 0;
            if (isalpha(s[i]) || isdigit(s[i]) || s[i] == '_') {
                if (i + 1 == s.size()) {
                    if ((i - x + 1) > 16 || (i - x + 1) < 1) return 0;
                }
                continue;
            }
            if (!isalpha(s[i]) || !isdigit(s[i]) || s[i] != '_') { return 0; }
        }
    }
    if (flag > 0)
        return 1;
    else
        return 0;
}
int main() {
    cin >> s;
    cout << (check() ? "YES" : "NO") << endl;
    return 0;
}