This works, if you know what you meant when you wrote . This does not mean 0.25 of course, but it refers to the inverse modulo 7, which is well defined since 2 and 7 are relatively prime. By the way, .

If what you've just read does not make sense for you (which wouldn't be surprising if you're new to "moduli"), you should avoid writing negative powers. For instance, you can notice that , hence . And you can go on like you did.