#include <bits/stdc++.h>
using namespace std;
string ss[] = {"monday", "tuesday",  "wednesday", "thursday",
               "friday", "saturday", "sunday"};
long long flag, a, b, i;
string s, d;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> s >> d;
  for (i = 0; i < 7; i++) {
    if (s == ss[i]) a = i;
    if (d == ss[i]) b = i;
  }
  for (i = 0; i <= 3; i++) {
    if (i == 1) continue;
    if ((a + i) % 7 == b) {
      flag = 1;
    }
  }
  if (flag)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
