#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b;
  map<string, int> mp;
  mp["monday"] = 1;
  mp["tuesday"] = 2;
  mp["wednesday"] = 3;
  mp["thursday"] = 4;
  mp["friday"] = 5;
  mp["saturday"] = 6;
  mp["sunday"] = 7;
  while (cin >> a >> b) {
    int d1 = mp[a], d2 = mp[b];
    int dif = (d2 - d1 + 7) % 7;
    if (28 % 7 == dif) {
      cout << "YES\n";
    } else if (30 % 7 == dif) {
      cout << "YES\n";
    } else if (31 % 7 == dif) {
      cout << "YES\n";
    } else
      cout << "NO\n";
  }
  return 0;
}
