The ratio between the masses of the flour bags is equal to the ratio oft the numbers 5 and 7.
[tex]7 \div 5 =1.4[/tex]
7 is 1.4 times bigger than 5.
That means the heavier bag contains 1.4 times more flour as the other one.
[tex]1120 \div 1.4 = 800[/tex]
The smaller bag has a mass of 800 grams.
I guess you can figure out the rest by yourself. ; - )