#include <bits/stdc++.h>
using namespace std;
int a[] = {28, 30, 31};
string b[] = {"monday", "tuesday",  "wednesday", "thursday",
              "friday", "saturday", "sunday"};
string first, second;
int f(string s) {
  for (int i = 0; i < 7; i++) {
    if (s == b[i]) return i;
  }
  return 0;
}
int main() {
  cin >> first >> second;
  int fir = f(first);
  int sec = f(second);
  int tmp;
  for (int i = 0; i < 3; i++) {
    tmp = a[i] - (7 - fir);
    if (tmp % 7 == sec) {
      cout << "YES\n";
      return 0;
    }
  }
  cout << "NO\n";
  return 0;
}
