#include <bits/stdc++.h>
using namespace std;
int main() {
  string days[] = {"monday", "tuesday",  "wednesday", "thursday",
                   "friday", "saturday", "sunday"};
  int dni[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  string a, b;
  cin >> a >> b;
  int x, y;
  for (int i = 0; i < 7; ++i) {
    if (a == days[i]) x = i;
    if (b == days[i]) y = i;
  }
  for (int i = 0; i < 11; ++i) {
    int z = x + dni[i];
    z %= 7;
    if (z == y) {
      cout << "YES\n";
      return 0;
    }
  }
  cout << "NO\n";
  return 0;
}
