Presuming that you knew what time Mass was going to be, then yes. Apparently there are some situations where the fasting isn’t required. When I was in the hospital after having a baby, the sister came in and asked if I wanted to receive communion and I was literally in the process of eating my lunch. (Ravenously, as it was the first food I’d been allowed since they induced labor 26.5 hours prior.) She assured me that it was alright in that situation, but I went ahead and declined anyway. It just didn’t feel right to receive the Lord with mustard on the side. Fortunately, another sister was working the floor where the NICU was so I was able to receive later that evening anyway.