Encrypting your files

By the way, I have a question when you encrypt your files on your usb using veracrypt and then your usb suddenly got infected by virus, is your files safe from the virus or not?