#include <bits/stdc++.h>
using namespace std;
int mnth[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
string day[7] = {"monday", "tuesday",  "wednesday", "thursday",
                 "friday", "saturday", "sunday"};
int main() {
  string s, t;
  cin >> s >> t;
  for (int i = 0; i < 12; i++)
    for (int j = 0; j < 7; j++) {
      if (day[j] == s && day[(j + mnth[i]) % 7] == t) return cout << "YES", 0;
    }
  cout << "NO";
  return 0;
}
