#include <bits/stdc++.h>
using namespace std;
int month[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, last[15];
int main() {
  map<string, int> mp;
  mp["monday"] = 0;
  mp["tuesday"] = 1;
  mp["wednesday"] = 2;
  mp["thursday"] = 3;
  mp["friday"] = 4;
  mp["saturday"] = 5;
  mp["sunday"] = 6;
  string str1, str2;
  cin >> str1 >> str2;
  int x = mp[str1], y = mp[str2];
  for (int j = 0; j < 7; j++) {
    int curr = j;
    for (int i = 0; i < 12; i++) {
      last[i] = curr;
      curr += month[i];
      curr %= 7;
      if (i && last[i - 1] == x && last[i] == y) return cout << "YES\n", 0;
    }
  }
  cout << "NO\n";
  return 0;
}
