#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int arr[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  string days[7] = {"monday", "tuesday",  "wednesday", "thursday",
                    "friday", "saturday", "sunday"};
  string s1, s2;
  cin >> s1 >> s2;
  map<string, int> pos;
  for (int i = 0; i < 7; i++) {
    pos[days[i]] = i;
  }
  for (int i = 0; i < 12; i++) {
    int num = pos[s1];
    num += arr[i];
    num %= 7;
    if (days[num] == s2) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
