#include <bits/stdc++.h>
using namespace std;
class Solution {
 public:
  void solve(string first) {
    const vector<int> months{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    const map<string, int> days{
        {"monday", 0}, {"tuesday", 1},  {"wednesday", 2}, {"thursday", 3},
        {"friday", 4}, {"saturday", 5}, {"sunday", 6}};
    string second;
    cin >> second;
    const int i_first = days.at(first), i_second = days.at(second);
    for (int start = 0; start < 7; ++start) {
      int cur_day = start;
      for (int m = 0; m < months.size() - 1; ++m) {
        const int next_day = (cur_day + months[m]) % 7;
        if (cur_day == i_first && next_day == i_second) {
          cout << "YES" << endl;
          return;
        }
        cur_day = next_day;
      }
    }
    cout << "NO" << endl;
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  for (string n; cin >> n;) {
    Solution solution;
    solution.solve(n);
  }
  cout.flush();
  return 0;
}
