#include <bits/stdc++.h>
char first[20];
char second[20];
int main() {
  scanf("%s", first);
  scanf("%s", second);
  if (strcmp(first, "sunday") == 0) {
    if (strcmp(second, "sunday") == 0 || strcmp(second, "tuesday") == 0 ||
        strcmp(second, "wednesday") == 0)
      printf("YES\n");
    else
      printf("NO\n");
  }
  if (strcmp(first, "monday") == 0) {
    if (strcmp(second, "monday") == 0 || strcmp(second, "wednesday") == 0 ||
        strcmp(second, "thursday") == 0)
      printf("YES\n");
    else
      printf("NO\n");
  }
  if (strcmp(first, "tuesday") == 0) {
    if (strcmp(second, "tuesday") == 0 || strcmp(second, "thursday") == 0 ||
        strcmp(second, "friday") == 0)
      printf("YES\n");
    else
      printf("NO\n");
  }
  if (strcmp(first, "wednesday") == 0) {
    if (strcmp(second, "wednesday") == 0 || strcmp(second, "friday") == 0 ||
        strcmp(second, "saturday") == 0)
      printf("YES\n");
    else
      printf("NO\n");
  }
  if (strcmp(first, "thursday") == 0) {
    if (strcmp(second, "thursday") == 0 || strcmp(second, "saturday") == 0 ||
        strcmp(second, "sunday") == 0)
      printf("YES\n");
    else
      printf("NO\n");
  }
  if (strcmp(first, "friday") == 0) {
    if (strcmp(second, "friday") == 0 || strcmp(second, "sunday") == 0 ||
        strcmp(second, "monday") == 0)
      printf("YES\n");
    else
      printf("NO\n");
  }
  if (strcmp(first, "saturday") == 0) {
    if (strcmp(second, "saturday") == 0 || strcmp(second, "monday") == 0 ||
        strcmp(second, "tuesday") == 0)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
