#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  map<string, int> months;
  months["monday"] = 0;
  months["tuesday"] = 1;
  months["wednesday"] = 2;
  months["thursday"] = 3;
  months["friday"] = 4;
  months["saturday"] = 5;
  months["sunday"] = 6;
  string s1, s2;
  cin >> s1 >> s2;
  if ((months[s1] + 31) % 7 == months[s2])
    cout << "YES" << endl;
  else if ((months[s1] + 30) % 7 == months[s2])
    cout << "YES" << endl;
  else if ((months[s1] + 28) % 7 == months[s2])
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
