#include <bits/stdc++.h>
int main() {
  char a[101];
  int i, j, k, x = 0, n;
  scanf("%s", a);
  n = strlen(a);
  for (i = 0; i < n; i++) {
    if (a[i] == '@') break;
    if (a[i] >= 'A' && a[i] <= 'Z')
      x = 1;
    else if (a[i] >= 'a' && a[i] <= 'z')
      x = 1;
    else if (a[i] == '_')
      x = 1;
    else if (a[i] >= '0' && a[i] <= '9')
      x = 1;
    else if (a[i] == '[' || a[i] == ']')
      x = 1;
    else {
      x = 0;
      break;
    }
  }
  if (a[i + 1] == '.' || a[i + 1] == '/' || a[i + 1] == '\0') x = 0;
  if (x != 0) {
    for (j = i + 1; j < n; j++) {
      if (a[j] == '/') break;
      if (a[j] >= 'A' && a[j] <= 'Z')
        x = 1;
      else if (a[j] >= 'a' && a[j] <= 'z')
        x = 1;
      else if (a[j] >= '0' && a[j] <= '9')
        x = 1;
      else if (a[j] == '_')
        x = 1;
      else if (a[j] == '.') {
        if (a[j + 1] != '.' && a[j + 1] != '\0' && a[j + 1] != '/')
          x = 1;
        else {
          x = 0;
          break;
        }
      } else if (a[i] == '[' || a[i] == ']')
        x = 1;
      else {
        x = 0;
        break;
      }
    }
  }
  if (a[j] == '/' && a[j + 1] == '\0') x = 0;
  if (x != 0) {
    for (k = j + 1; k < n; k++) {
      if (a[k] >= 'A' && a[k] <= 'Z')
        x = 1;
      else if (a[k] >= 'a' && a[k] <= 'z')
        x = 1;
      else if (a[k] == '_')
        x = 1;
      else if (a[k] >= '0' && a[k] <= '9')
        x = 1;
      else if (a[k] == '[' || a[k] == ']')
        x = 1;
      else {
        x = 0;
        break;
      }
    }
  }
  if (x == 0)
    printf("NO\n");
  else
    printf("YES\n");
  return 0;
}
