How many permutations of the string ABCDEFG are there where A is somewhere before B?
If A is the first letter you have posibilities.
If A is the second letter you have posibilities.
If A is the third letter you have posibilities.
If A is the fourth letter you have posibilities.
If A is the fifth letter you have posibilities.
If A is the sixth letter you have posibilities.
If A is the seventh letter you have no posibilities.
So, your answer is