#include <bits/stdc++.h>
int min(int a, int b) { return (a < b ? a : b); }
int max(int a, int b) { return (a > b ? a : b); }
int main() {
  char a[10], b[10];
  int x, y;
  scanf("%s\n%s", a, b);
  if (strcmp(a, "sunday") == 0)
    x = 0;
  else if (strcmp(a, "monday") == 0)
    x = 1;
  else if (strcmp(a, "tuesday") == 0)
    x = 2;
  else if (strcmp(a, "wednesday") == 0)
    x = 3;
  else if (strcmp(a, "thursday") == 0)
    x = 4;
  else if (strcmp(a, "friday") == 0)
    x = 5;
  else if (strcmp(a, "saturday") == 0)
    x = 6;
  if (strcmp(b, "sunday") == 0)
    y = 0;
  else if (strcmp(b, "monday") == 0)
    y = 1;
  else if (strcmp(b, "tuesday") == 0)
    y = 2;
  else if (strcmp(b, "wednesday") == 0)
    y = 3;
  else if (strcmp(b, "thursday") == 0)
    y = 4;
  else if (strcmp(b, "friday") == 0)
    y = 5;
  else if (strcmp(b, "saturday") == 0)
    y = 6;
  if (x == y)
    printf("YES");
  else if (y == (x + 2) % 7)
    printf("YES");
  else if (y == (x + 3) % 7)
    printf("YES");
  else
    printf("NO");
  return 0;
}
