#include <bits/stdc++.h>
using namespace std;
int days[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
char wee[][15] = {"sunday",   "monday", "tuesday", "wednesday",
                  "thursday", "friday", "saturday"};
char s[15];
int main() {
  int a, b;
  scanf("%s", s);
  for (int i = 0; i < 7; i++)
    if (strcmp(s, wee[i]) == 0) {
      a = i;
      break;
    }
  scanf("%s", s);
  for (int i = 0; i < 7; i++)
    if (strcmp(s, wee[i]) == 0) {
      b = i;
      break;
    }
  int f = 0;
  for (int i = 0; i < 12; i++)
    if ((a + days[i]) % 7 == b) {
      f = 1;
      break;
    }
  if (f)
    puts("YES");
  else
    puts("NO");
  return 0;
}
