#include <bits/stdc++.h>
using namespace std;
string s;
string name, host, sour;
int main() {
  ios::sync_with_stdio(false);
  cin >> s;
  int i = 0;
  while (i < s.size() && s[i] != '@') {
    name.push_back(s[i]);
    i++;
  }
  i++;
  while (i < s.size() && s[i] != '/') {
    host.push_back(s[i]);
    i++;
  }
  bool exist = 0;
  if (s[i] == '/') exist = 1;
  i++;
  if (i != s.size() + 1)
    while (i < s.size()) {
      sour.push_back(s[i]);
      i++;
    }
  if (sour.size() > 16 || name.size() == 0 || name.size() > 16 ||
      host.size() > 32 || host.size() == 0) {
    cout << "NO\n";
    return 0;
  }
  if (exist && sour.size() == 0) {
    cout << "NO\n";
    return 0;
  }
  for (int j = 0; j < name.size(); j++) {
    char c = name[j];
    if (!isdigit(c) && !isalpha(c) && (c != '<' && c != '>' && c != '_')) {
      cout << "NO\n";
      return 0;
    }
  }
  int cnt = 0;
  for (int j = 0; j < host.size(); j++) {
    char c = host[j];
    if (!isdigit(c) && !isalpha(c) &&
        (c != '<' && c != '>' && c != '.' && c != '_')) {
      cout << "NO\n";
      return 0;
    }
    if (c == '.') {
      if (cnt == 0) {
        cout << "NO\n";
        return 0;
      }
      cnt = -1;
    }
    cnt++;
    if (cnt > 16) {
      cout << "NO\n";
      return 0;
    }
  }
  if (cnt == 0) {
    cout << "NO\n";
    return 0;
  }
  for (int j = 0; j < sour.size(); j++) {
    char c = sour[j];
    if (!isalpha(c) && !isdigit(c) && (c != '<' && c != '>' && c != '_')) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  return 0;
}
