Yesterday, a movie theater sold 301 bags of popcorn. A large bag of popcorn costs $3. A small bag of popcorn costs $1. In all, the movie theater made $507 from popcorn sales. Write and solve a system of equations to find how many bags of each size of popcorn were sold.