#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2;
  while (cin >> s1 >> s2) {
    int S1, S2;
    if (s1 == "monday") S1 = 1;
    if (s1 == "tuesday") S1 = 2;
    if (s1 == "wednesday") S1 = 3;
    if (s1 == "thursday") S1 = 4;
    if (s1 == "friday") S1 = 5;
    if (s1 == "saturday") S1 = 6;
    if (s1 == "sunday") S1 = 7;
    if (s2 == "monday") S2 = 1;
    if (s2 == "tuesday") S2 = 2;
    if (s2 == "wednesday") S2 = 3;
    if (s2 == "thursday") S2 = 4;
    if (s2 == "friday") S2 = 5;
    if (s2 == "saturday") S2 = 6;
    if (s2 == "sunday") S2 = 7;
    int n = S2 - S1;
    if (n < 0) n += 7;
    if (31 % 7 == n || 28 % 7 == n || 30 % 7 == n)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
