#include <bits/stdc++.h>
using namespace std;
int ToNum(string &str) {
  if (str == "monday") {
    return 1;
  } else if (str == "tuesday") {
    return 2;
  } else if (str == "wednesday") {
    return 3;
  } else if (str == "thursday") {
    return 4;
  } else if (str == "friday") {
    return 5;
  } else if (str == "saturday") {
    return 6;
  } else if (str == "sunday") {
    return 7;
  }
}
int main() {
  string first, second;
  int f_num, s_num;
  cin >> first >> second;
  int res;
  if (ToNum(first) > ToNum(second)) {
    res = 7 - (ToNum(first) - ToNum(second));
  } else {
    res = ToNum(second) - ToNum(first);
  }
  if (res == 0 || res == 3 || res == 2) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
