#include <bits/stdc++.h>
int main(void) {
  int months[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  char days[7][15] = {"monday", "tuesday",  "wednesday", "thursday",
                      "friday", "saturday", "sunday"};
  char day1[15], day2[15];
  int d1;
  scanf("%s%s", day1, day2);
  int i;
  for (i = 0; i < 7; i++)
    if (strcmp(days[i], day1) == 0) {
      d1 = i;
      break;
    }
  for (i = 0; i < 12; i++)
    if (strcmp(days[(d1 + months[i]) % 7], day2) == 0) {
      printf("YES\n");
      return 0;
    }
  printf("NO\n");
  return 0;
}
