#include <bits/stdc++.h>
using namespace std;
long long int mod = 1000000007;
int main() {
  ios::sync_with_stdio(false);
  int k1, k2;
  char s1[15];
  char s2[15];
  cin >> s1 >> s2;
  if (strcmp(s1, "sunday") == 0)
    k1 = 1;
  else if (strcmp(s1, "monday") == 0)
    k1 = 2;
  else if (strcmp(s1, "tuesday") == 0)
    k1 = 3;
  else if (strcmp(s1, "wednesday") == 0)
    k1 = 4;
  else if (strcmp(s1, "thursday") == 0)
    k1 = 5;
  else if (strcmp(s1, "friday") == 0)
    k1 = 6;
  else if (strcmp(s1, "saturday") == 0)
    k1 = 7;
  if (strcmp(s2, "sunday") == 0)
    k2 = 1;
  else if (strcmp(s2, "monday") == 0)
    k2 = 2;
  else if (strcmp(s2, "tuesday") == 0)
    k2 = 3;
  else if (strcmp(s2, "wednesday") == 0)
    k2 = 4;
  else if (strcmp(s2, "thursday") == 0)
    k2 = 5;
  else if (strcmp(s2, "friday") == 0)
    k2 = 6;
  else if (strcmp(s2, "saturday") == 0)
    k2 = 7;
  if (k1 == k2)
    cout << "YES\n";
  else if (k1 > k2) {
    k2 += 7;
    int p = abs(k1 - k2);
    if (p == 2 || p == 3)
      cout << "YES\n";
    else
      cout << "NO\n";
  } else if (k1 < k2) {
    int p = abs(k1 - k2);
    if (p == 2 || p == 3)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
