#include <bits/stdc++.h>
using namespace std;
map<string, int> a;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  a["monday"] = 0;
  a["tuesday"] = 1;
  a["wednesday"] = 2;
  a["thursday"] = 3;
  a["friday"] = 4;
  a["saturday"] = 5;
  a["sunday"] = 6;
  string s1, s2;
  cin >> s1 >> s2;
  int a1 = a[s1];
  int a2 = a[s2];
  for (int i = 28; i <= 31; i++) {
    if (i == 29) continue;
    if ((a1 + i) % 7 == a2) return cout << "YES", 0;
  }
  cout << "NO";
}
