OBSERVATIONS AND SIMULATIONS OF THE Na i D1 LINE PROFILES IN AN M-CLASS SOLAR FLARE