The ratio between the masses of the flour bags is equal to the ratio oft the numbers 5 and 7.

7 is 1.4 times bigger than 5.
That means the heavier bag contains 1.4 times more flour as the other one.

The smaller bag has a mass of 800 grams.
I guess you can figure out the rest by yourself. ; - )