#include <bits/stdc++.h>
using namespace std;
char s[15], t[15];
char m[10][15] = {"monday", "tuesday",  "wednesday", "thursday",
                  "friday", "saturday", "sunday"};
int x, y, cnt;
int main() {
  scanf("%s %s", s, t);
  for (int i = 0; i < 7; i++) {
    if (strcmp(s, m[i]) == 0) x = i + 1;
  }
  for (int i = 0; i < 7; i++) {
    if (strcmp(t, m[i]) == 0) y = i + 1;
  }
  while (x != y) {
    x++;
    if (x == 8) x = 1;
    cnt++;
  }
  if (cnt == 3 || cnt == 0 || cnt == 2)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
