It's important to get in the habit of taking a systematic approach. This really is pretty simple. All the mass involved in the pipe, tank, etc. has to be accounted for in one of these five processes. Nothing accumulates, so accumulation is zero. All the mass that comes in, goes out, though individual components may be produced or consumed.
Nothing accumulates, and nothing reacts.
What goes in, comes out unchanged, and there are only two non-zero terms in the basic equation.