From a quick google search. It seems like flies are actually beneficial for the environment! Apparently they are useful for consuming decaying matter. If they were to go extinct, then it could cause some issues.
Although mosquitos on the other hand, I don't care what they do for the environment. They could go extinct.