#include <bits/stdc++.h>
using namespace std;
string a, b, c[7] = {"monday", "tuesday",  "wednesday", "thursday",
                     "friday", "saturday", "sunday"};
int h, m[3] = {31, 28, 30}, q;
int main() {
  cin >> a >> b;
  for (q = 0; q < 7; q++)
    if (a == c[q]) {
      h = q;
      break;
    }
  for (int j = 0; j < 3; j++) {
    h = q;
    for (int i = 0; i < m[j]; i++) {
      h++;
      if (h > 6) h = 0;
    }
    if (c[h] == b) goto n;
  }
  cout << "NO";
  return 0;
n:;
  cout << "YES";
  return 0;
}
