#include <bits/stdc++.h>
char *s[7] = {"monday", "tuesday",  "wednesday", "thursday",
              "friday", "saturday", "sunday"};
int main() {
  int a, b, i;
  char s1[10], s2[10];
  scanf("%s\n%s", s1, s2);
  for (i = 0; i < 7; i++) {
    if (!strcmp(s1, s[i])) a = i;
    if (!strcmp(s2, s[i])) b = i;
  }
  if (a == b || (a + 2) % 7 == b || (a + 3) % 7 == b)
    printf("YES");
  else
    printf("NO");
  return 0;
}
