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