It depends on what you want it to do. Technically, you can do it with just an accelerometer. Or just a gyro if you wanted. Generally, the best way to go for an accurate yaw/pitch/roll measurement you would want all 3, accel, gyro, & mag. Without a magnetmometer, your measurements will be subject to yaw drift. Without a gyro, your yaw/pitch/roll measurements will not be very accurate, especially when the sensor is subjected to bumpiness. Your yaw/pitch/roll readings would only be valid if the accelerometer were rotating smoothly and slowly, or steady-state positioning.