#include <bits/stdc++.h>
using namespace std;
int dp[3000001][20];
int last[20];
int arr[3000001];
int main() {
  int num, q;
  cin >> num >> q;
  for (int i = 0; i < num; ++i) cin >> arr[i];
  for (int j = 0; j < 19; ++j) {
    last[j] = num;
    dp[num][j] = num;
  }
  for (int i = num - 1; i >= 0; --i) {
    for (int j = 0; j <= 19; ++j) {
      dp[i][j] = num;
    }
    for (int j = 0; j <= 19; ++j) {
      if ((arr[i] & (1 << j)) > 0) {
        dp[i][j] = i;
        int found = last[j];
        for (int k = 0; k <= 19; ++k) {
          dp[i][k] = min(dp[i][k], dp[found][k]);
        }
        last[j] = i;
      }
    }
  }
  int l, r;
  for (int i = 0; i < q; ++i) {
    cin >> l >> r;
    l--;
    r--;
    bool f = false;
    for (int j = 0; j <= 19; ++j) {
      if ((arr[r] & (1 << j)) > 0 && dp[l][j] <= r) {
        f = true;
        break;
      }
    }
    if (f) {
      cout << "Shi" << endl;
    } else {
      cout << "Fou" << endl;
    }
  }
  return 0;
}
