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