<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _check_input(self, X, R):
 """Check whether input data and coordinates in right type Parameters X : list of 2D arrays, element i has shape=[voxels_i, samples] Each element in the list contains the fMRI data of one subject. R : list of 2D arrays, element i has shape=[n_voxel, n_dim] Each element in the list contains the scanner coordinate matrix of fMRI data of one subject. Returns ------- HTFA Returns the instance itself. """

        # Check data type
        if not isinstance(X, list):
            raise TypeError("Input data should be a list")

        if not isinstance(R, list):
            raise TypeError("Coordinates should be a list")

        # Check the number of subjects
        if len(X) < 1:
            raise ValueError("Need at leat one subject to train the model.\
                              Got {0:d}".format(len(X)))

        for idx, x in enumerate(X):
            if not isinstance(x, np.ndarray):
                raise TypeError("Each subject data should be an array")
            if x.ndim != 2:
                raise TypeError("Each subject data should be 2D array")
            if not isinstance(R[idx], np.ndarray):
                raise TypeError(
                    "Each scanner coordinate matrix should be an array")
            if R[idx].ndim != 2:
                raise TypeError(
                    "Each scanner coordinate matrix should be 2D array")
            if x.shape[0] != R[idx].shape[0]:
                raise TypeError(
                    "n_voxel should be the same in X[idx] and R[idx]")
        return self