#include <bits/stdc++.h>
using namespace std;
string ara[7] = {"monday", "tuesday",  "wednesday", "thursday",
                 "friday", "saturday", "sunday"};
int main() {
  string s1, s2;
  int a, b;
  cin >> s1 >> s2;
  for (int i = 0; i < 7; i++) {
    if (ara[i] == s1) a = i;
    if (ara[i] == s2) b = i;
  }
  int diff = (b - a + 7) % 7;
  if (diff == 0 || diff == 2 || diff == 3)
    printf("YES");
  else
    printf("NO");
}
