Is m a derived unit?

m can mean milli or 10-3 and as such is a multiplier not a unit

m = mass (kg) or other is a fundamental and not a derived unit

M = moles is a fundamental unit

m = meter is a fundamental unit and not derived