#include <bits/stdc++.h>
using namespace std;
string ss[] = {"sunday",   "monday", "tuesday", "wednesday",
               "thursday", "friday", "saturday"};
int main() {
  string fir, sec;
  int f, s;
  cin >> fir >> sec;
  for (int i = 0; i < 7; i++) {
    if (fir == ss[i]) f = i;
    if (sec == ss[i]) s = i;
  }
  int tmp = (s - f + 7) % 7;
  if (tmp == 0 || tmp == 2 || tmp == 3)
    printf("YES\n");
  else
    printf("NO\n");
}
