#include <bits/stdc++.h>
using namespace std;
char a[105], b[105];
int main() {
  string c[7] = {"monday", "tuesday",  "wednesday", "thursday",
                 "friday", "saturday", "sunday"};
  int i, flag = 0;
  cin >> a >> b;
  for (i = 0; i < 7; i++) {
    if (c[i] == a &&
        (c[i] == b || c[(i + 2) % 7] == b || c[(i + 3) % 7] == b)) {
      flag = 1;
      cout << "YES" << endl;
      break;
    }
  }
  if (flag == 0) {
    cout << "NO" << endl;
  }
  return 0;
}
