#include <bits/stdc++.h>
using namespace std;
map<string, int> mapka;
int v1, v2;
string slowo1, slowo2;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> slowo1 >> slowo2;
  mapka["monday"] = 0;
  mapka["tuesday"] = 1;
  mapka["wednesday"] = 2;
  mapka["thursday"] = 3;
  mapka["friday"] = 4;
  mapka["saturday"] = 5;
  mapka["sunday"] = 6;
  v1 = mapka[slowo1];
  v2 = mapka[slowo2];
  v1 = (v2 - v1 + 7) % 7;
  if (v1 == 0 || v1 == 2 || v1 == 3)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
