#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using ld = long double;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
using i64 = std::int_fast64_t;
const static i64 mod = 1000000007;
struct mint {
  i64 n;

 public:
  mint(const i64 n = 0) : n((n % mod + mod) % mod) {}
  mint pow(int m) const {
    i64 a = n, r = 1;
    while (m > 0) {
      if (m & 1) {
        r *= a;
        r %= mod;
      }
      a = (a * a) % mod;
      m /= 2;
    }
    return mint(r);
  }
  mint& operator++() {
    *this += 1;
    return *this;
  }
  mint& operator--() {
    *this -= 1;
    return *this;
  }
  mint operator++(int) {
    mint ret = *this;
    *this += 1;
    return ret;
  }
  mint operator--(int) {
    mint ret = *this;
    *this -= 1;
    return ret;
  }
  mint operator~() const { return (this->pow(mod - 2)); }
  friend bool operator==(const mint& lhs, const mint& rhs) {
    return lhs.n == rhs.n;
  }
  friend bool operator<(const mint& lhs, const mint& rhs) {
    return lhs.n < rhs.n;
  }
  friend bool operator>(const mint& lhs, const mint& rhs) {
    return lhs.n > rhs.n;
  }
  friend mint& operator+=(mint& lhs, const mint& rhs) {
    lhs.n += rhs.n;
    if (lhs.n >= mod) lhs.n -= mod;
    return lhs;
  }
  friend mint& operator-=(mint& lhs, const mint& rhs) {
    lhs.n -= rhs.n;
    if (lhs.n < 0) lhs.n += mod;
    return lhs;
  }
  friend mint& operator*=(mint& lhs, const mint& rhs) {
    lhs.n = (lhs.n * rhs.n) % mod;
    return lhs;
  }
  friend mint& operator/=(mint& lhs, const mint& rhs) {
    lhs.n = (lhs.n * (~rhs).n) % mod;
    return lhs;
  }
  friend mint operator+(const mint& lhs, const mint& rhs) {
    return mint(lhs.n + rhs.n);
  }
  friend mint operator-(const mint& lhs, const mint& rhs) {
    return mint(lhs.n - rhs.n);
  }
  friend mint operator*(const mint& lhs, const mint& rhs) {
    return mint(lhs.n * rhs.n);
  }
  friend mint operator/(const mint& lhs, const mint& rhs) {
    return mint(lhs.n * (~rhs).n);
  }
};
istream& operator>>(istream& is, mint& m) {
  is >> m.n;
  return is;
}
ostream& operator<<(ostream& os, mint& m) {
  os << m.n;
  return os;
}
void google_solve() { return; }
void google() {
  int t;
  cin >> t;
  for (lint i = 0; i < (int)t; i++) {
    cout << "Case #" << i + 1 << ": ";
    google_solve();
  }
}
int main() {
  int n, q;
  cin >> n >> q;
  vector<int> a(n);
  for (lint i = 0; i < (int)n; i++) cin >> a[i];
  vector<vector<pint>> que(n);
  string ans[300000];
  for (lint i = 0; i < (int)q; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    que[x].push_back({y, i});
  }
  int v[20][20];
  for (lint i = 0; i < (int)20; i++)
    for (lint j = 0; j < (int)20; j++) {
      if (i == j)
        v[i][j] = -1;
      else
        v[i][j] = 1000000000LL;
    }
  for (int i = n - 1; i >= 0; i--) {
    bitset<20> bi(a[i]);
    int b = 1000000000LL;
    for (lint j = 0; j < (int)20; j++) {
      if (!bi[j]) continue;
      if (b == 1000000000LL) {
        b = j;
        continue;
      }
      for (lint k = 0; k < (int)20; k++) {
        v[j][k] = min(v[j][k], max(i, v[b][k]));
      }
      b = j;
    }
    b = 1000000000LL;
    for (int j = 19; j >= 0; j--) {
      if (!bi[j]) continue;
      if (b == 1000000000LL) {
        b = j;
        continue;
      }
      for (lint k = 0; k < (int)20; k++) {
        v[j][k] = min(v[j][k], max(i, v[b][k]));
      }
      b = j;
    }
    for (lint j = 0; j < (int)que[i].size(); j++) {
      bitset<20> bi2(a[que[i][j].first]);
      bool ok = false;
      for (lint k = 0; k < (int)20; k++)
        for (lint l = 0; l < (int)20; l++) {
          if (bi[k] && bi2[l] && v[k][l] <= que[i][j].first) ok = true;
        }
      if (ok)
        ans[que[i][j].second] = "Shi";
      else
        ans[que[i][j].second] = "Fou";
    }
  }
  for (lint i = 0; i < (int)q; i++) printf("%s\n", ans[i].c_str());
  return 0;
}
