#include <bits/stdc++.h>
using namespace std;
vector<string> v;
int main() {
  string s1, s2;
  cin >> s1 >> s2;
  string str1, str2, str3, str4, str5, str6, str7;
  str1 = "monday";
  str2 = "tuesday";
  str3 = "wednesday";
  str4 = "thursday";
  str5 = "friday";
  str6 = "saturday";
  str7 = "sunday";
  if (s1 == s2) {
    cout << "YES" << endl;
  } else {
    if (s1 == str1) {
      if (s2 == str3 || s2 == str4) {
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
    }
    if (s1 == str2) {
      if (s2 == str4 || s2 == str5) {
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
    }
    if (s1 == str3) {
      if (s2 == str5 || s2 == str6) {
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
    }
    if (s1 == str4) {
      if (s2 == str6 || s2 == str7) {
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
    }
    if (s1 == str5) {
      if (s2 == str7 || s2 == str1) {
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
    }
    if (s1 == str6) {
      if (s2 == str1 || s2 == str2) {
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
    }
    if (s1 == str7) {
      if (s2 == str2 || s2 == str3) {
        cout << "YES" << endl;
      } else {
        cout << "NO" << endl;
      }
    }
  }
  return 0;
}
