#include <bits/stdc++.h>
using namespace std;
string s[2];
int checkWeek(string str) {
  if (str == "monday")
    return 0;
  else if (str == "tuesday")
    return 1;
  else if (str == "wednesday")
    return 2;
  else if (str == "thursday")
    return 3;
  else if (str == "friday")
    return 4;
  else if (str == "saturday")
    return 5;
  else
    return 6;
}
int main(int argc, char const *argv[]) {
  cin >> s[0] >> s[1];
  int week[2];
  week[0] = checkWeek(s[0]);
  week[1] = checkWeek(s[1]);
  int tmp = 0;
  if (week[0] == week[1]) {
    printf("YES\n");
    return 0;
  } else if (week[0] > week[1])
    tmp = week[1] + 7 - week[0];
  else
    tmp = week[1] - week[0];
  if (tmp == 2 || tmp == 3)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
