#include <bits/stdc++.h>
using namespace std;
string s[7] = {"monday", "tuesday",  "wednesday", "thursday",
               "friday", "saturday", "sunday"};
int year[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int main() {
  int pos1, pos2, flag, i;
  string s1, s2;
  while (cin >> s1 >> s2) {
    flag = 0;
    for (i = 0; i < 7; i++) {
      if (s[i] == s1) pos1 = i;
      if (s[i] == s2) pos2 = i;
    }
    for (i = 0; i < 11; i++) {
      if ((year[i] + pos1) % 7 == pos2) flag = 1;
    }
    if (flag == 1)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
