This is valid through the law of syllogism. If you swap lines 1 and 2, then you'll have this argument:
If I step on a beehive, then I will get stung.
If I get stung by a bee, then it will hurt.
Therefore, if I step on a beehive, then it will hurt
------------------
So it's like connecting a chain together. Point A (stepping on the hive), leads to point B (getting stung), which leads to point C (getting hurt). We can take a shortcut to bypass point B to jump from A to C in one step. Check out the attached image for a visual of what I'm referring to.
Given that the last term is -3x^4, the polynomila is ordered in descending order of the exponent of x. Then, the first term is that where y is with the highest exponent, that is y^4
Simplify the terms with y^4: -2y^4 + 6y^4 = 4y^4
Then the first term is 4y^4
1/5 is the simplest form of the fraction