#include <bits/stdc++.h>
int main() {
  int s, q;
  char arr[10], are[10];
  gets(arr);
  gets(are);
  if (strcmp(arr, "monday") == 0)
    s = 1;
  else if (strcmp(arr, "tuesday") == 0)
    s = 2;
  else if (strcmp(arr, "wednesday") == 0)
    s = 3;
  else if (strcmp(arr, "thursday") == 0)
    s = 4;
  else if (strcmp(arr, "friday") == 0)
    s = 5;
  else if (strcmp(arr, "saturday") == 0)
    s = 6;
  else if (strcmp(arr, "sunday") == 0)
    s = 7;
  if (strcmp(are, "monday") == 0)
    q = 1;
  else if (strcmp(are, "tuesday") == 0)
    q = 2;
  else if (strcmp(are, "wednesday") == 0)
    q = 3;
  else if (strcmp(are, "thursday") == 0)
    q = 4;
  else if (strcmp(are, "friday") == 0)
    q = 5;
  else if (strcmp(are, "saturday") == 0)
    q = 6;
  else if (strcmp(are, "sunday") == 0)
    q = 7;
  int z = q - s;
  if (z < 0) z += 7;
  if (z == 0 || z == 2 || z == 3)
    printf("YES");
  else
    printf("NO");
  return 0;
}
