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