#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b;
  cin >> a >> b;
  map<string, int> m = {{"sunday", 0},    {"monday", 1},   {"tuesday", 2},
                        {"wednesday", 3}, {"thursday", 4}, {"friday", 5},
                        {"saturday", 6}};
  int n = (m[b] - m[a] + 7) % 7;
  cout << (n == 0 or n == 2 or n == 3 ? "YES" : "NO");
  return 0;
}
