[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]:
boolean function l that takes character c as argument
    return true if c is a letter
    return true if c is a capital letter
    return true if c is a digit
    return true if c is an underscore
    return false
end of the block
function un with string argument s
    set value of int n to length s
    if n is 0 or n > 16 return false
    for i = 0 to n exclusive
        if l(s at index i) is false return false
    end of the block
    return true
end of the block
function hn with string argument s
    declare integers n = size of s, i, nw = 0
    if n is 0 or n > 32 return false
    appen character '.' to s
    for i = 0 to n + 1 exclusive
        if s[i] is character "."
            if nw is equal to 0 or nw is greater than 16 return false
            nw = 0
        else
            if l(s at index i) is false return false
            increase nw
        end of the block
    end of the block
    return true
end of the block
boolean function r with string argument s
    return un(s)
end of the block
boolean function f with string argument s
    int n = length of s, i, j
    for i = 0 to n exclusive
        if s at index i is "@" break the loop
    end of the block
    if i is equal to n return false
    if un(substring of s from 0 to i) is false return false
    for j = from i + 1 to n exclusive
        if s[j] is "/" break the loop
    end of the block
    if hn(substring of s from i + 1 to j - i - 1) is false return false
    if j is not equal to n and r(substring of s from 0 to j +1) is false return false
    return true
end of the block
let s be string
define the main function
    read s
    if f(s)
        print "YES" and a new line
    else
        print "NO" and a new line
    end of the block
    return to indicate successful execution
end of the block

[CODE]:

bool l(char c) {
    if (c >= 'a' && c <= 'z') { return true; }
    if (c >= 'A' && c <= 'Z') { return true; }
    if (c >= '0' && c <= '9') { return true; }
    if (c == '_') { return true; }
    return false;
}
bool un(string s) {
    int n = s.size();
    if (n == 0 || n > 16) { return false; }
    for (int i = 0; i < n; i++) {
        if (!l(s[i])) { return false; }
    }
    return true;
}
bool hn(string s) {
    int n = s.size(), i, nw = 0;
    if (n == 0 || n > 32) { return false; }
    s += '.';
    for (i = 0; i < n + 1; i++) {
        if (s[i] == '.') {
            if (nw == 0 || nw > 16) { return false; }
            nw = 0;
        } else {
            if (!l(s[i])) { return false; }
            nw++;
        }
    }
    return true;
}
bool r(string s) {
    return un(s);
}
bool f(string s) {
    int n = s.size(), i, j;
    for (i = 0; i < n; i++) {
        if (s[i] == '@') { break; }
    }
    if (i == n) { return false; }
    if (!un(s.substr(0, i))) { return false; }
    for (j = i + 1; j < n; j++) {
        if (s[j] == '/') { break; }
    }
    if (!hn(s.substr(i + 1, j - i - 1))) { return false; }
    if (j != n && !r(s.substr(j + 1))) { return false; }
    return true;
}
string s;
int main() {
    cin >> s;
    if (f(s)) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
    return 0;
}