#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string fd, ld;
  cin >> fd >> ld;
  if (fd == ld)
    cout << "YES";
  else {
    if (fd == "monday" && (ld == "thursday" || ld == "wednesday"))
      cout << "YES";
    else if (fd == "tuesday" && (ld == "friday" || ld == "thursday"))
      cout << "YES";
    else if (fd == "wednesday" && (ld == "saturday" || ld == "friday"))
      cout << "YES";
    else if (fd == "thursday" && (ld == "sunday" || ld == "saturday"))
      cout << "YES";
    else if (fd == "friday" && (ld == "monday" || ld == "sunday"))
      cout << "YES";
    else if (fd == "saturday" && (ld == "tuesday" || ld == "monday"))
      cout << "YES";
    else if (fd == "sunday" && (ld == "wednesday" || ld == "tuesday"))
      cout << "YES";
    else
      cout << "NO";
  }
  return 0;
}
