Is today a real weekday? Feb. 6 was a real weekday. Because it lies in the 6th week of the year.
So a real weekday is a day with a a day number that equals the week number.

But not all country have the same counting of weeks. in Germany a week starts with Monday and ends on Saturday in the US they start on Sunday.

Write a program that checks a given date (the format your program likes the best) and a weekstart ('S' or 'M') whether it is a real weekday.

Too simplify things a bit we assume January 1st is always a real weekday because it is in the first week. In Germany it is the last day of week 52)

Some examples of real weekday for a start on Monday:

 2017-01-01
 2017-02-07
 2017-04-17


Some examples of real weekday for a start on Sunday:

2017-01-01
2017-02-06
2017-04-16


Example:

2017-04-16 S Output: YES
20170416M Output: 0


How you enter the Date does not matter, as long as it is human readable. The start day can be given by M or S or 1 or 0.
the Output is a printed boolean Yes, not or Y,N or 0,1

Shortest code wins!

Its my first question I put on this forum, so I'd be happy to hear some comments.
MATLAB, 53 bytes
d=datetime(input(''));week(d-(input('')=='M'))==d.Day

This answer accepts the first input as a string '2017-02-06' and the second input as a string (either 'S' or 'M').

It constructs a datetime object from the first input and saves it in d. We then compute the week number (but first we subtract 1 day from the date if the second input is an 'M' since week uses Sundays by default) and then we compare this week number to the day of the datetime object to yield a boolean.